sczesla / PyAstronomy

A collection of astronomy-related routines in Python
152 stars 35 forks source link

pip install numpy pyastronomy fails. #22

Closed jason-neal closed 7 years ago

jason-neal commented 7 years ago

The main issue is https://github.com/pypa/pip/issues/25 but it is a fairly common issue.

In a new environment

pip install numpy pyastronomy
Collecting numpy
  Downloading numpy-1.12.1-cp35-cp35m-manylinux1_x86_64.whl (16.8MB)
    100% |████████████████████████████████| 16.8MB 1.8MB/s 
Collecting pyastronomy
  Downloading PyAstronomy-0.10.1.tar.gz (617kB)
    100% |████████████████████████████████| 624kB 2.2MB/s 
    Complete output from command python setup.py egg_info:
    Please install 'numpy' first.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/jneal/pip-build-r24zffou/pyastronomy/setup.py", line 153, in <module>
        class WithExtCommand(Command):
    NameError: name 'Command' is not defined

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/jneal/pip-build-r24zffou/pyastronomy/

Basically https://github.com/scipy/scipy/pull/453 contains the PR of how they resolved this issue for scipy which I quote.

It was failing because of the pre installation request from pip to ./setup.py egg_info (which is perfectly valid request and shouldn't fail), before numpy actually was installed.

Fix is straightforward - not to use numpy for commands that are not connected with build and install.

The main reason this affects me is I want to include pyastronomy into a requirements.txt file along with numpy. pip downloads and setups all before starting to install.

sczesla commented 7 years ago

Hi, I modified setup.py and uploaded a new release 0.11.0 to pypi. According to my tests, this resolves the issue. Cheers, Stefan