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

Installation issues (requires numpy) #8

Closed
jason-neal opened this issue Nov 24, 2016 · 11 comments
Closed

Installation issues (requires numpy) #8

jason-neal opened this issue Nov 24, 2016 · 11 comments
Labels

Comments

@jason-neal
Copy link
Collaborator

Hi, I tried cloning this to work on it in a new conda environment.
Running the command
pip install -r requirements.txt
results in ...

Collecting PyAstronomy (from -r requirements.txt (line 5))
Using cached PyAstronomy-0.10.1.tar.gz
Complete output from command python setup.py egg_info:
Please install 'numpy' first.
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-wM5T99/PyAstronomy/setup.py", line 153, in
class WithExtCommand(Command):
NameError: name 'Command' is not defined

It seems PyAstronomy needs numpy to be installed properly. I tried reordering the requirements.txt file so PyAstronomy was last but that did not solve the issue. It downloads them all first before installing.

I don't know if there is an automatic fix to this solution to this other than running
pip install numpy first. (which works).

@j-faria
Copy link
Member

j-faria commented Nov 24, 2016

Does this work?

conda create -n new_environment_name --file requirement.txt

@jason-neal
Copy link
Collaborator Author

No because PyAstronomy is not in conda I think.

conda create  -n new_env --file requirements.txt  
Fetching package metadata .......
Solving package specifications: .
Error: Package missing in current linux-64 channels: 
  - pyastronomy

You can search for packages on anaconda.org with

    anaconda search -t conda pyastronomy

@DanielAndreasen
Copy link
Collaborator

Maybe I do something wrong, but when I run conda create -n name; source activate name this enviroment has all the packages installed from my root enviroment...

I don't think this is a big concern as most people who might use this will have numpy installed. But let's fix it anyway.

@jason-neal
Copy link
Collaborator Author

I did a quick google search and this thread has some solutions.

Basically you need to download/build/install one at a time using something like
xargs -L 1 pip install < requirements.txt
-L1 specifies that it only reads( and installs) one line at a time from requirements.

Maybe this can be added to the README.

@DanielAndreasen
Copy link
Collaborator

Better to just make a Makefile for this.

@jason-neal
Copy link
Collaborator Author

Yea I checked and I don't have PyAstronomy in my root conda. The installation did work if there was already built/cached versions of the packages known to pip.

@DanielAndreasen
Copy link
Collaborator

Maybe this can be a solution: https://github.com/pypa/pipfile

@jason-neal
Copy link
Collaborator Author

This is the result of pypa/pip#25 which is a common issue.
I have opened sczesla/PyAstronomy#22 to fix pyastronomy's setup.py file.

@j-faria
Copy link
Member

j-faria commented Apr 24, 2017

Wondering if https://github.com/sdispater/poet would solve this...

@jason-neal
Copy link
Collaborator Author

jason-neal commented Apr 24, 2017

I tested it and it still gives the same error. Neat project though. Yet another way to package python....

Simplified the problem is the pyastronomy setup.py file has a bare import numpy.... call. This is run by pip when searching all the requirements to find all the dependencies to install. Since it has not installed numpy yet it fails. Hopefully it can be changed on pyastronomy's side and the problem will disappear.

jason-neal added a commit that referenced this issue Jun 14, 2017
PyAstronomy version 0.11 resolved issue #8.
@jason-neal
Copy link
Collaborator Author

I have added a version dependence in the requirements.txt file for version pyastronomy>=0.11. The recent 0.11 release resolved the issue discussed here.

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

No branches or pull requests

3 participants