pyflow icon indicating copy to clipboard operation
pyflow copied to clipboard

Can't import numpy c-extension on 3.9

Open erooke opened this issue 3 years ago • 2 comments

Creating a new 3.9 project and installing numpy 1.22.2 results in a broken numpy install.

The only command I've run is pyflow install numpy which resulted in the following pyproject.toml

[tool.pyflow]
name = "npTest"
py_version = "3.9"
version = "0.1.0"

[tool.pyflow.scripts]

[tool.pyflow.dependencies]
numpy = "^1.22.2"

[tool.pyflow.dev-dependencies]

Running pyflow python and then import numpy as np triggers the following complaint

ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.9 from "/home/ethan/code/npTest/__pypackages__/3.9/.venv/bin/python"
  * The NumPy version is: "1.22.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

Not sure where to really proceed from there in the way of debugging however.

erooke avatar Feb 23 '22 05:02 erooke

In my case, eventhough I'm not importing numpy, the same error message appear. I have from jax import random. which actually I'm not sure if that package has numpy as it's deps

harisraharjo avatar Jun 07 '22 15:06 harisraharjo

@harisraharjo jax does in fact import numpy

GallagherCommaJack avatar Jun 08 '22 13:06 GallagherCommaJack