pip install fails claiming that numpy is not installed
Windows Server Both
pip install pyprophet and pip install git+https://github.com/PyProphet/pyprophet.git@master fails on numpy even though numpy is installed:
PS C:\Windows\system32> pip install git+https://github.com/PyProphet/pyprophet.git@master
Collecting git+https://github.com/PyProphet/pyprophet.git@master
Cloning https://github.com/PyProphet/pyprophet.git (to revision master) to c:\users\ketilkl-null\appdata\local\temp\pip-req-build-rgg9yyv9
Running command git clone --filter=blob:none --quiet https://github.com/PyProphet/pyprophet.git 'C:\Users\ketilkl-null\AppData\Local\Temp\pip-req-build-rgg9yyv9'
Resolved https://github.com/PyProphet/pyprophet.git to commit 31eecfe066b41533b707658a4e62edcab33866e8
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
Traceback (most recent call last):
File "C:\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ketilkl-null\AppData\Local\Temp\pip-build-env-46tms50f\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ketilkl-null\AppData\Local\Temp\pip-build-env-46tms50f\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "C:\Users\ketilkl-null\AppData\Local\Temp\pip-build-env-46tms50f\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
super().run_setup(setup_script=setup_script)
File "C:\Users\ketilkl-null\AppData\Local\Temp\pip-build-env-46tms50f\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'numpy'
[end of output]
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
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I just tried this on a windows machine with python 3.9 and didn't get the same error. Is numpy already installed, and can you import it in python? If not can you install numpy alone using pip install numpy?
(base) PS C:\Users\roestlab> pip install git+https://github.com/PyProphet/pyprophet.git@master
Collecting git+https://github.com/PyProphet/pyprophet.git@master
Cloning https://github.com/PyProphet/pyprophet.git (to revision master) to c:\users\roestlab\appdata\local\temp\pip-req-build-cxhu8s0z
Running command git clone --quiet https://github.com/PyProphet/pyprophet.git 'C:\Users\roestlab\AppData\Local\Temp\pip-req-build-cxhu8s0z'
Resolved https://github.com/PyProphet/pyprophet.git to commit 31eecfe066b41533b707658a4e62edcab33866e8
Preparing metadata (setup.py) ... done
Requirement already satisfied: Click in c:\users\roestlab\anaconda3\lib\site-packages (from pyprophet==2.2.5) (8.0.4)
Requirement already satisfied: numpy>=1.9.0 in c:\users\roestlab\anaconda3\lib\site-packages (from pyprophet==2.2.5) (1.21.5)
Requirement already satisfied: scipy in c:\users\roestlab\anaconda3\lib\site-packages (from pyprophet==2.2.5) (1.9.1)
Requirement already satisfied: pandas>=0.17 in c:\users\roestlab\anaconda3\lib\site-packages (from pyprophet==2.2.5) (1.4.4)
Requirement already satisfied: cython in c:\users\roestlab\anaconda3\lib\site-packages (from pyprophet==2.2.5) (0.29.32)
Requirement already satisfied: numexpr>=2.1 in c:\users\roestlab\anaconda3\lib\site-packages (from pyprophet==2.2.5) (2.8.3)
Requirement already satisfied: scikit-learn>=0.17 in c:\users\roestlab\anaconda3\lib\site-packages (from pyprophet==2.2.5) (1.0.2)
Requirement already satisfied: xgboost in c:\users\roestlab\anaconda3\lib\site-packages (from pyprophet==2.2.5) (1.7.5)
Requirement already satisfied: hyperopt in c:\users\roestlab\anaconda3\lib\site-packages (from pyprophet==2.2.5) (0.2.7)
Requirement already satisfied: statsmodels>=0.8.0 in c:\users\roestlab\anaconda3\lib\site-packages (from pyprophet==2.2.5) (0.13.2)
Requirement already satisfied: matplotlib in c:\users\roestlab\anaconda3\lib\site-packages (from pyprophet==2.2.5) (3.5.2)
Requirement already satisfied: tabulate in c:\users\roestlab\anaconda3\lib\site-packages (from pyprophet==2.2.5) (0.8.10)
Collecting pypdf
Downloading pypdf-4.2.0-py3-none-any.whl (290 kB)
---------------------------------------- 290.4/290.4 kB 17.5 MB/s eta 0:00:00
Requirement already satisfied: packaging in c:\users\roestlab\anaconda3\lib\site-packages (from numexpr>=2.1->pyprophet==2.2.5) (21.3)
Requirement already satisfied: python-dateutil>=2.8.1 in c:\users\roestlab\anaconda3\lib\site-packages (from pandas>=0.17->pyprophet==2.2.5) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in c:\users\roestlab\anaconda3\lib\site-packages (from pandas>=0.17->pyprophet==2.2.5) (2022.1)
Requirement already satisfied: threadpoolctl>=2.0.0 in c:\users\roestlab\anaconda3\lib\site-packages (from scikit-learn>=0.17->pyprophet==2.2.5) (2.2.0)
Requirement already satisfied: joblib>=0.11 in c:\users\roestlab\anaconda3\lib\site-packages (from scikit-learn>=0.17->pyprophet==2.2.5) (1.1.0)
Requirement already satisfied: patsy>=0.5.2 in c:\users\roestlab\anaconda3\lib\site-packages (from statsmodels>=0.8.0->pyprophet==2.2.5) (0.5.2)
Requirement already satisfied: colorama in c:\users\roestlab\anaconda3\lib\site-packages (from Click->pyprophet==2.2.5) (0.4.5)
Requirement already satisfied: future in c:\users\roestlab\anaconda3\lib\site-packages (from hyperopt->pyprophet==2.2.5) (0.18.2)
Requirement already satisfied: networkx>=2.2 in c:\users\roestlab\anaconda3\lib\site-packages (from hyperopt->pyprophet==2.2.5) (2.8.4)
Requirement already satisfied: py4j in c:\users\roestlab\anaconda3\lib\site-packages (from hyperopt->pyprophet==2.2.5) (0.10.9.7)
Requirement already satisfied: six in c:\users\roestlab\anaconda3\lib\site-packages (from hyperopt->pyprophet==2.2.5) (1.16.0)
Requirement already satisfied: tqdm in c:\users\roestlab\anaconda3\lib\site-packages (from hyperopt->pyprophet==2.2.5) (4.64.1)
Requirement already satisfied: cloudpickle in c:\users\roestlab\anaconda3\lib\site-packages (from hyperopt->pyprophet==2.2.5) (2.0.0)
Requirement already satisfied: pyparsing>=2.2.1 in c:\users\roestlab\anaconda3\lib\site-packages (from matplotlib->pyprophet==2.2.5) (3.0.9)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\roestlab\anaconda3\lib\site-packages (from matplotlib->pyprophet==2.2.5) (1.4.2)
Requirement already satisfied: pillow>=6.2.0 in c:\users\roestlab\anaconda3\lib\site-packages (from matplotlib->pyprophet==2.2.5) (9.2.0)
Requirement already satisfied: cycler>=0.10 in c:\users\roestlab\anaconda3\lib\site-packages (from matplotlib->pyprophet==2.2.5) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in c:\users\roestlab\anaconda3\lib\site-packages (from matplotlib->pyprophet==2.2.5) (4.25.0)
Requirement already satisfied: typing_extensions>=4.0 in c:\users\roestlab\anaconda3\lib\site-packages (from pypdf->pyprophet==2.2.5) (4.3.0)
Installing collected packages: pypdf
Successfully installed pypdf-4.2.0
Python 3.12.3 - Tried with latest numpy installed already and without numpy installed. Same result.
Okay, I seem to get the same error when using python 3.10, 3.11 and 3.12. There may have been a change in how numpy gets installed with later versions of python.
For now, can you use a python environment using python 3.9?
Hi, I'm having issues with all versions, including 3.9. Is there a solution to this problem?
Hi, I'm having issues with all versions, including 3.9. Is there a solution to this problem?
Hi, this seems to be an issue with the latest major release of numpy 2.0. I will try to update the code to use the latest numpy changes.
For now, can you try the following using python 3.9
pip install cython==0.29.30
pip install numpy==1.25.0
pip install pyprophet
This should fix the numpy version to the latest version prior to 2.0 that works with python 3.9 and pyprophet.
@singjc Awesome, thank you so much.