Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy Missing During Setuptools #36

Closed
John-P opened this issue Mar 3, 2022 · 1 comment
Closed

Numpy Missing During Setuptools #36

John-P opened this issue Mar 3, 2022 · 1 comment

Comments

@John-P
Copy link

John-P commented Mar 3, 2022

Hi there, I am having an issue where sometimes setuptools is running the finalize_options function but numpy is not installed yet:

...
File "/opt/python/3.7.1/lib/python3.7/distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
File "/tmp/pip-install-9ehdn6oz/imagecodecs/setup.py", line 600, in finalize_options
        import numpy
    ModuleNotFoundError: No module named 'numpy'

This appears to only happen on certain setups, perhaps just if pip tries to install imagecodecs before NumPy.

I found the recommendation to add numpy to setup_requires (see numpy/numpy#2434) in addition to install_requires but I see that you have commented this out here

# setup_requires=['setuptools>=18.0', 'numpy>=1.19.2'], # cython>=0.29.27

I just wanted to check if there is a reason it was commented out or if you have any advice to avoid this issue? I am currently just using a regular pip install from a requirements file.

@John-P
Copy link
Author

John-P commented Mar 3, 2022

It appears that I was using python 3.7 which didn't help as you specify 3.8+. Using 3.8 and above I no longer have this issue.

@John-P John-P closed this as completed Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant