Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

pip fails to install at same time of numpy #60

Closed
Marco-Santoni opened this issue Sep 18, 2014 · 4 comments
Closed

pip fails to install at same time of numpy #60

Marco-Santoni opened this issue Sep 18, 2014 · 4 comments
Assignees
Labels
Milestone

Comments

@Marco-Santoni
Copy link

If neither numpy nor pyearth are installed, and we install both of them by:

$ pip install -r requirements.txt

where requirements.txt:

numpy
scipy
-e git+https://github.com/jcrudy/py-earth.git#egg=py-earth

Throws ImportError: no module named numpy when installing pyearth. Refer to this issue and this issue to see how pip works in this case.

@jcrudy jcrudy added the bug label Sep 22, 2014
@jcrudy jcrudy self-assigned this Sep 22, 2014
@jcrudy
Copy link
Collaborator

jcrudy commented Sep 22, 2014

Thanks for reporting this @Marco-Santoni. From my quick read of pypa/pip#25 I think I understand the problem and how to fix it. I'll close this issue when fixed.

@Marco-Santoni
Copy link
Author

Thanks, as I need to fix this asap, I've forked the repo and tried to fix the setup.py. However, as I'm not confident with setup.py and Cython, I cannot solve it. Could you please explain how you would solve it, or even commit the fix?

@jcrudy
Copy link
Collaborator

jcrudy commented Oct 6, 2014

Well, I think the solution has to do with ilblackdragon's comment near the end of the pypa/pip#25.

It's better to handle egg_info, clean and help commands as special case (at least this is what has been done in scipy (https://github.com/scipy/scipy/blob/master/setup.py) and some other libraries that depend on numpy):

if '--help' in sys.argv[1:] or \
    sys.argv[1] in ('--help-commands', 'egg_info', 'clean', '--version'):
    ...
else:
    import numpy
    ...

The problem has to do with the fact that setup.py imports numpy in order to determine the build path. However, when just trying to get package dependency information on a system without numpy, this import causes an error. You would need to change setup.py so that it imports numpy only if it's actually going to do a build. At least that is my understanding.

I wish I could help more. If you have trouble, post more questions. I just have some projects going on right now and don't really have time to set up a testing environment and experiment with this. I should be able to respond to questions, though. If I get time, I will try to fix this from my end, but I expect that won't happen until next week.

@jcrudy jcrudy mentioned this issue Mar 24, 2016
@jcrudy jcrudy added this to the 0.1 milestone Mar 24, 2016
mehdidc added a commit to mehdidc/py-earth that referenced this issue Mar 25, 2016
mehdidc added a commit to mehdidc/py-earth that referenced this issue Mar 25, 2016
mehdidc added a commit to mehdidc/py-earth that referenced this issue Mar 25, 2016
jcrudy added a commit that referenced this issue Mar 25, 2016
@jcrudy
Copy link
Collaborator

jcrudy commented Mar 25, 2016

Fixed by @mehdidc in PR #98.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants