-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
numpy installation thru install_requires directive issue (Trac #1841) #2434
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
Comments
@rgommers wrote on 2011-05-27 I'm not sure exactly what the problem is, but can you get around it by just running an install script that first installs numpy and then your package? Relying on these badly-documented setuptools features is not a good idea if you can avoid it. If I'd have to guess, I'd say calling setuptools.setup() for the first time invokes a bunch of magic that screws up something for numpy.distutils, hence:
That warning comes from distutils/misc_util.py. |
trac user ijstokes wrote on 2011-06-08 I just had this same error and for me it seems it is caused by some dependency problems. If I re-try the easy_install with the other modules, they work the second time 'round. My best guess is that some dependency is only "visible" after the easy_install session ends. Ian |
Is it possible to get this fixed at some point? This causes workarounds where there should be non IHMO. I'd really like to get to a point where numpy can be specified in the |
It's possible of course, if someone invests time to really understand the issue and submits a clean fix. It's not a prio for me personally - |
Can you confirm that the same problem still occurs with modern distutils/setuptools/pip? |
It does. Sent from my iPad On 29 Nov 2013, at 7:22, njsmith [email protected] wrote: Can you confirm that the same problem still occurs with modern — |
Just ran across this issue so can confirm it's there. The option OS: Mac 10.8.3 |
Hitting this issue to. Not a show stopped, but definitely annoying. Especially because it's not in any way obvious that it's a bug rather than some user/env issue. |
I've just tried reproducing this by installing pandas (which uses
If someone can give an easy way to reproduce this, that would help. |
I also have this issue in a 2.7 virtual env. os ubuntu wheezy |
@zethraeus could you provide a set of commands to reproduce this (like in my comment above)? It's hard to fix if we can't reproduce the issue. |
Hi! Sorry it took so long, but here's a reproducer. |
Thanks for the example @kejbaly2, I can reproduce it now. |
Same issue on SO: And in Red Hat bug tracker: https://bugzilla.redhat.com/show_bug.cgi?id=1019924 There's more things that |
Having a very similar issue with trying to use install_requires and numpy Here is how I can reproduce the error on Red Hat 6.5 |
As an FYI for anyone experiencing this issue, with the latest version of setup(
...
setup_requires=["numpy"],
install_requires=["numpy"],
) This works, and only installs NumPy once, on both Mac OS X and Linux (not tested on Windows). As for why I have no clue. |
See #16 and http://stackoverflow.com/questions/27497470/setuptools-finds-wrong-package-during-install Multiple hours of 100's of Google searches eventually took me to this numpy thread: numpy/numpy#2434 (comment) for which they had to add numpy to AND to fix a similar issue. Doing this with requests seems to have worked. However, I am somewhat skeptical as posters on SO indicated they did not see our problem in the first place. I tried on my Mac as well as on Ubuntu (dbserver02), and am able to install from a clean virtualenv on both systems. Fix #16 for now.
See #16 and http://stackoverflow.com/questions/27497470/setuptools-finds-wrong-package-during-install Multiple hours of 100's of Google searches eventually took me to this numpy thread: numpy/numpy#2434 (comment) for which they had to add numpy to `setup_requires` AND `install_requires` to fix a similar issue. Doing this with requests seems to have worked. However, I am somewhat skeptical as posters on SO indicated they did not see our problem in the first place. I may just be getting lucky. I tried on my Mac as well as on Ubuntu (dbserver02), and am able to install from a clean virtualenv on both systems. Fix #16 for now.
I've been trying to track down a similar issue that can occur sometimes when Numpy's build is being run by way of I've tracked it down to this ancient (but in principle still relevant, at least slightly?) bit of code: Line 92 in 9fc0773
In most cases when running Numpy's setup.py, it shoves a function called It then calls the Where this all runs afoul is that the To back up a bit and hopefully clarify--when running the There are a number of possible workarounds to this, both from setuptools end and/or the Numpy end. I haven't decided what the best approach would be, but the whole thing is definitely a mess :) |
For what it's worth, one possible workaround from the setuptools end would be for As it happens, I believe the current version of setuptools may already fix that by hiding away the original Update: Confirmed, the issue I described above is worked around (somewhat by happy accident) in setuptools >= 10.0. |
@embray that's a nice bit of detective work! (and it hurts my head a little:) ) You're right that |
@rgommers The thing is, that workaround for easy_install was added a very long time ago, and I don't believe it to be entirely necessary anymore (not only for the fact that easy_install itself is effectively deprecated, though I know there are still a handful of good reasons people have to use it). I'll see if I can come up with a patch that addresses the original issue while not being a problem in other contexts. |
@embray sounds good. If you get a patch ready and it doesn't get reviewed within ~2 weeks, please do kick me (gently) |
setup_requires=["numpy"] didn't work for me. I got this error message: AttributeError: 'module' object has no attribute 'get_include'. But running "python setup.py install" a second time fixed the problem. See also http://stackoverflow.com/questions/21605927/why-doesnt-setup-requires-work-properly-for-numpy |
Just in case the gist in #2434 (comment) disappears at some point, here's a copy of how to reproduce this issue:
|
See #16 and http://stackoverflow.com/questions/27497470/setuptools-finds-wrong-package-during-install Multiple hours of 100's of Google searches eventually took me to this numpy thread: numpy/numpy#2434 (comment) for which they had to add numpy to `setup_requires` AND `install_requires` to fix a similar issue. Doing this with requests seems to have worked. However, I am somewhat skeptical as posters on SO indicated they did not see our problem in the first place. I may just be getting lucky. I tried on my Mac as well as on Ubuntu (dbserver02), and am able to install from a clean virtualenv on both systems. Fix #16 for now.
Numpy sometimes fails to properly install when just within the install_requires (see [#2434](numpy/numpy#2434)) so I also added it to setup_requires. Also changed from using scripts => entry_points:{'console_scripts'} and the command to `VHostScan` within the README for consistency.
Add rasterio to setup_requires and install_requires To fix numpy/numpy#2434
Rasterio depends on numpy, which must be present in the virtualenv before installation. See numpy/numpy#2434.
Rasterio depends on numpy, which must be present in the virtualenv before installation. See numpy/numpy#2434.
Rasterio depends on numpy, which must be present in the virtualenv before installation. See numpy/numpy#2434.
For some reason the automatic install of pandas will fail compilation due to numpy. A workaround for this issue is to specify numpy in `setup_requires` as mentioned in numpy/numpy#2434
For some reason the automatic install of pandas will fail compilation due to numpy. A workaround for this issue is to specify numpy in `setup_requires` as mentioned in numpy/numpy#2434
For some reason the automatic install of pandas will fail compilation due to numpy. A workaround for this issue is to specify numpy in `setup_requires` as mentioned in numpy/numpy#2434
For some reason the automatic install of pandas will fail compilation due to an issue with numpy. A workaround for this issue is to specify numpy in `setup_requires` as mentioned in numpy/numpy#2434
For some reason the automatic install of pandas will fail compilation due to an issue with numpy. A workaround for this issue is to specify numpy in `setup_requires` as mentioned in numpy/numpy#2434
For some reason the automatic install of pandas will fail compilation due to an issue with numpy. A workaround for this issue is to specify numpy in `setup_requires` as mentioned in numpy/numpy#2434
having hard time installing pandas in python2.7.16 using pip install -R requirements.txt https://files.pythonhosted.org/packages/b2/4c/b6f966ac91c5670ba4ef0b0b5613b5379e3c7abdfad4e7b89a87d73bae13/pandas-0.24.2.tar.gz (11.8MB)
Not sure why it's look for numpy-1.17.0rc1 which is not support for python2 Any help would be appreciated, thanks |
Please share your |
Requirement file contains: flask==1.0.2 Finally manage it to work keeping the numpy inside requirement file and later installing pandas Run command in docker: RUN pip install https://github.com/pydata/pandas/releases/download/v0.24.2/pandas-0.24.2.tar.gz However, now there is another issue in compiling it's say you need to install cython to compile pandas. Error: Exception: Cython-generated file 'pandas/io/sas/sas.c' not found. Any idea? |
Not connected to this issue which concerns using |
Yes I will open this issue in pandas library. However, the post that I mentioned earlier thats related to numPy since you can not install pandas directly numPy is properly installed on Python2.7 under docker env. Exception: Cython-generated file 'pandas/msgpack.c' not found. So I need to use release version of pandas to be installed from tarball |
Closing. I think the python world is moving away from setup(
...
setup_requires=["numpy"],
install_requires=["numpy"],
) As for @omeryounus trying to install numpy on python2, that is a separate issue not connected to this one. Some users have reported that upgrading pip and setuptools to the most recent version helped with that problem. Please reopen if there is more to discuss around |
Original ticket http://projects.scipy.org/numpy/ticket/1841 on 2011-05-25 by trac user ohe, assigned to unknown.
Hello there,
In a virtualenv, with python v2.7.1, i can't install numpy thru the install_requires directive of setuptools/distribute.
A
python setup.py install
gives me the following traceback :I have no probleme to install numpy with
pip install numpy
oreasy_install numpy
inside or outside any virtualenv.OS: Mac OS 10.6.7
The text was updated successfully, but these errors were encountered: