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

Install via pip requirements.txt error #99

Closed
rowanxyt opened this issue Dec 13, 2018 · 8 comments
Closed

Install via pip requirements.txt error #99

rowanxyt opened this issue Dec 13, 2018 · 8 comments

Comments

@rowanxyt
Copy link

I was trying to do a pip install using a requirements.txt file and it failed. Details:

  1. The pip command used: python -m pip install -r requirements.txt. Python==3.6.5, pip==9.0.3;
  2. The requirements.txt contained two lines: line 1: numpy==1.15.0, line 2: numpy-quaternion==2018.11.3.1.0.41.

The error was:

Collecting numpy-quaternion==2018.11.3.1.0.41 (from -r requirements.txt (line 25))
Using cached https://files.pythonhosted.org/packages/3c/5d/e58d67cd579061aa2c392dfeef510ba35b89d208d8ec689b0b0438c3632c/numpy-quaternion-2018.11.3.1.0.41.tar.gz
Complete output from command python setup.py egg_info:
The variable 'package_version' was not present in the environment
Setup.py using strftime version='2018.12.12.21.45.36'
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-0iuc7nb6/numpy-quaternion/setup.py", line 54, in
import numpy
ModuleNotFoundError: No module named 'numpy'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-0iuc7nb6/numpy-quaternion/

Environment

  • Ubuntu 16.04

I know I could install them one at a time (numpy first and numpy-quaternion second) and it worked. But it would be more convenient if I could use the requirements.txt method.

@moble
Copy link
Owner

moble commented Feb 7, 2019

It looks like this may be doable with the hack from this SO answer (despite the fact that Travis Oliphant himself said it was impossible in the answer just below that one, even though all the same techniques were available when he answered). I'll give it a try next time I have a few minutes.

CC: @Achllle @jvgomez

@Achllle
Copy link

Achllle commented Mar 21, 2019

I tried this and it worked as long as you remove the default version of numpy that's installed on Travis using sudo pip uninstall numpy -y.

@bluenote10
Copy link

Would be great if this could be fixed because it breaks working with a single pip install -r requirements.txt.

There a lots of packages that depend on numpy w/ headers (pandas, sklearn, etc.), yet they don't depend on it at install time. How have they solved the problem, are they all using this "hack"?

@j9ac9k
Copy link

j9ac9k commented Mar 30, 2019

Here is the commit that addressed this w/ PyMC3

https://github.com/pymc-devs/pymc/pull/94/files

Also read through this scikit-learn issue: scikit-learn/scikit-learn#4164

@moble
Copy link
Owner

moble commented Jun 26, 2019

My most recent commits have tried to implement the various proposed solutions. I'm hesitant to close this issue, though, because I've never actually run into the problem. So would the rest of you please try it out?

@Achllle
Copy link

Achllle commented Jun 26, 2019

I reverted the hacks that we discussed here and ran it on travis, you can see that the build succeeded here. However it seems like I still need to remove the root numpy installation and reinstall it in the .travis.yml for it to work (failing build).
However I did recently try installing on a new fresh installation of Ubuntu 16.04 and it did fail (don't remember the exact error, but it was also a numpy issue).

@moble
Copy link
Owner

moble commented Jun 26, 2019

However I did recently try installing on a new fresh installation of Ubuntu 16.04 and it did fail (don't remember the exact error, but it was also a numpy issue).

This is just within the past day.

In fact, just now I've added some more things that people have claimed make pip work correctly. At this point, I'm past the end of my rope with pip. If this isn't working now for some other pip configurations, it's never going to work. But I really think it should work, so I'm closing this issue.

@rowanxyt
Copy link
Author

rowanxyt commented Jul 3, 2019

Yeah I tried the "python -m pip install -r requirements.txt" method with the requirements.txt containing numpy==1.15.0 and numpy-quaternion==2019.6.26.15.8.24 and it worked. Thank you!

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

5 participants