pip install is throwing "ModuleNotFoundError: No module named 'numpy'" error even though numpy is installed
Hello,
I'm trying to install pyimfit on my Windows 10 machine through Anaconda. Even though I have updated my current version on numpy, running the command:
pip install pyimfit --use-pep517
Gives me following output:
Collecting pyimfit Using cached pyimfit-0.12.0.tar.gz (10.7 MB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'error' Note: you may need to restart the kernel to use updated packages. error: subprocess-exited-with-error
Getting requirements to build wheel did not run successfully. exit code: 1
[17 lines of output]
Traceback (most recent call last):
File "C:\Users*\AppData\Roaming\Python\Python39\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error
Getting requirements to build wheel did not run successfully. exit code: 1
Hi,
I'm not sure I can help very much, as I don't have access to a Windows machine and so have never tried developing Imfit or PyImfit on Windows. (I also don't use Anaconda Python very much, but that's probably less of an issue.)
It sounds as if there's a problem finding the numpy library (even though it's installed). You might try searching online to see if anyone else has similar problems (e.g., trying to compile a Python library for use on Windows 10 with Anaconda), even if it's for libraries that have nothing to do with Imfit.
It turns out I get a similar problem when trying to install pyimfit for continuous-integration testing using Github Actions. The problem seems to be related to recent versions of pip; a workaround is to specify an older version of pip:
python -m pip install --upgrade pip==22.3.1
before running pip install pyimfit.
(You can then probably restore the latest version of pip by doing python -m pip install --upgrade pip after you've installed pyimfit.)
(This may not work with Python 3.12, since that breaks older versions of pip.)