ericmandel / pyds9

Python connection to SAOimage DS9 via XPA
76 stars 41 forks source link

Problem with installation (on a Mac with anaconda) #42

Closed svw26 closed 8 years ago

svw26 commented 8 years ago

Hello

I installed XPA and am now trying to install pyds9, following the advice in issue #38, by using the following commands:

git clone --recursive https://github.com/ericmandel/pyds9.git cd pyds9 git submodule init git submodule update python setup.py install

There is no output following the two 'git submodule' commands - I'm assuming that this is expected - and then I get the following for the final command:

running install running bdist_egg running egg_info writing requirements to pyds9.egg-info/requires.txt writing pyds9.egg-info/PKG-INFO writing top-level names to pyds9.egg-info/top_level.txt writing dependency_links to pyds9.egg-info/dependency_links.txt writing entry points to pyds9.egg-info/entry_points.txt reading manifest file 'pyds9.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'COPYING' warning: no files found matching '.c' under directory '.pyx' warning: no files found matching '.pxd' under directory '.pyx' warning: no files found matching '' under directory 'scripts' no previously-included directories found matching 'build' no previously-included directories found matching 'docs/_build' no previously-included directories found matching 'docs/api' warning: no previously-included files matching '.o' found anywhere in distribution writing manifest file 'pyds9.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.5-x86_64/egg running install_lib running build_py running build_ext running pre_hook from pyds9.setup_package for build_ext command pre_build_ext_hook command hook build_ext raised an exception: %s

Traceback (most recent call last): File "/Users/sarahwhite/pyds9/astropy_helpers/astropy_helpers/setup_helpers.py", line 289, in run_command_hooks hook_obj(cmd_obj) File "pyds9/setup_package.py", line 87, in pre_build_ext_hook libxpa = cmd.ext_map['pyds9.libxpa'] File "/Applications/anaconda/lib/python2.7/site-packages/Cython/Distutils/build_ext.py", line 135, in getattr return build_ext.build_ext._getattr(self, name) File "/Applications/anaconda/lib/python2.7/distutils/cmd.py", line 105, in getattr raise AttributeError, attr AttributeError: ext_map

Please could you advise what to try next?

Many thanks x

montefra commented 8 years ago

Thank you.

I'll try to investigate it today. I hope to solve this.

montefra commented 8 years ago

For the records: I just tried your exact same steps on my linux machine and it succeed in every case:

I don't have a mac myself to try.

What I find strange is:

File "/Applications/anaconda/lib/python2.7/distutils/cmd.py", line 105, in getattr
raise AttributeError, attr

AttributeError: ext_map

given that cmd is a astropy_helpers.setup_helpers.build_ext instance.

Would you mind replacing installation by

pip install .

or

pip install git+https://github.com/ericmandel/pyds9.git

and report back?

svw26 commented 8 years ago

Many thanks for looking into this. I deleted the pyds9 directory, from the previous attempt, and ran 'pip install git+https://github.com/ericmandel/pyds9.git' as you suggested. Unfortunately it returns the following:

dhcp202-8-37-224:~ sarahwhite$ pip install git+https://github.com/ericmandel/pyds9.git Collecting git+https://github.com/ericmandel/pyds9.git Cloning https://github.com/ericmandel/pyds9.git to /var/folders/68/rstxyb653cjc_frp6zmf2kw40000gn/T/pip-vM707x-build Requirement already satisfied (use --upgrade to upgrade): astropy in /Applications/anaconda/lib/python2.7/site-packages (from pyds9==1.9.dev123) Requirement already satisfied (use --upgrade to upgrade): numpy in /Applications/anaconda/lib/python2.7/site-packages (from pyds9==1.9.dev123) Installing collected packages: pyds9 Running setup.py install for pyds9 ... error Complete output from command /Applications/anaconda/bin/python -u -c "import setuptools, tokenize;file='/var/folders/68/rstxyb653cjc_frp6zmf2kw40000gn/T/pip-vM707x-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/68/rstxyb653cjc_frp6zmf2kw40000gn/T/pip-UKeb4S-record/install-record.txt --single-version-externally-managed --compile: /Applications/anaconda/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') running install running build running build_py creating build creating build/lib.macosx-10.5-x86_64-2.7 creating build/lib.macosx-10.5-x86_64-2.7/pyds9 copying pyds9/init.py -> build/lib.macosx-10.5-x86_64-2.7/pyds9 copying pyds9/_astropy_init.py -> build/lib.macosx-10.5-x86_64-2.7/pyds9 copying pyds9/conftest.py -> build/lib.macosx-10.5-x86_64-2.7/pyds9 copying pyds9/pyds9.py -> build/lib.macosx-10.5-x86_64-2.7/pyds9 copying pyds9/setup_package.py -> build/lib.macosx-10.5-x86_64-2.7/pyds9 copying pyds9/version.py -> build/lib.macosx-10.5-x86_64-2.7/pyds9 copying pyds9/xpa.py -> build/lib.macosx-10.5-x86_64-2.7/pyds9 creating build/lib.macosx-10.5-x86_64-2.7/pyds9/extern copying pyds9/extern/init.py -> build/lib.macosx-10.5-x86_64-2.7/pyds9/extern creating build/lib.macosx-10.5-x86_64-2.7/pyds9/tests copying pyds9/tests/init.py -> build/lib.macosx-10.5-x86_64-2.7/pyds9/tests copying pyds9/tests/setup_package.py -> build/lib.macosx-10.5-x86_64-2.7/pyds9/tests copying pyds9/tests/test_fits.py -> build/lib.macosx-10.5-x86_64-2.7/pyds9/tests creating build/lib.macosx-10.5-x86_64-2.7/pyds9/utils copying pyds9/utils/init.py -> build/lib.macosx-10.5-x86_64-2.7/pyds9/utils creating build/lib.macosx-10.5-x86_64-2.7/pyds9/data copying pyds9/data/README.rst -> build/lib.macosx-10.5-x86_64-2.7/pyds9/data copying pyds9/_compiler.c -> build/lib.macosx-10.5-x86_64-2.7/pyds9 copying pyds9/tests/coveragerc -> build/lib.macosx-10.5-x86_64-2.7/pyds9/tests running build_ext running pre_hook from pyds9.setup_package for build_ext command pre_build_ext_hook command hook build_ext raised an exception: %s

Traceback (most recent call last):
  File "/private/var/folders/68/rstxyb653cjc_frp6zmf2kw40000gn/T/pip-vM707x-build/astropy_helpers/astropy_helpers/setup_helpers.py", line 289, in run_command_hooks
    hook_obj(cmd_obj)
  File "pyds9/setup_package.py", line 87, in pre_build_ext_hook
    libxpa = cmd.ext_map['pyds9.libxpa']
  File "/Applications/anaconda/lib/python2.7/site-packages/Cython/Distutils/build_ext.py", line 135, in __getattr__
    return _build_ext.build_ext.__getattr__(self, name)
  File "/Applications/anaconda/lib/python2.7/distutils/cmd.py", line 105, in __getattr__
    raise AttributeError, attr
AttributeError: ext_map

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

Command "/Applications/anaconda/bin/python -u -c "import setuptools, tokenize;file='/var/folders/68/rstxyb653cjc_frp6zmf2kw40000gn/T/pip-vM707x-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/68/rstxyb653cjc_frp6zmf2kw40000gn/T/pip-UKeb4S-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /var/folders/68/rstxyb653cjc_frp6zmf2kw40000gn/T/pip-vM707x-build/

montefra commented 8 years ago

I had other two issues with the same problem: #44 and #45

montefra commented 8 years ago

On my system PR #48 solves the problem. I'll merge the PR soon. However I want to setup Travis CI first at least to test installation.

If you want to test the installation, you can do it with:

pip install git+https://github.com/montefra/pyds9.git@install_cython#eggs=pyds9

montefra commented 8 years ago

48 solves the issue