Skip to content

Error with install --enable-legacy#1488

Merged
astrofrog merged 1 commit intoastropy:masterfrom
mdboom:setup/fix-legacy
Sep 29, 2013
Merged

Error with install --enable-legacy#1488
astrofrog merged 1 commit intoastropy:masterfrom
mdboom:setup/fix-legacy

Conversation

@mdboom
Copy link
Contributor

@mdboom mdboom commented Sep 26, 2013

On Mac and Linux I can't manage to install astropy with the --enable-legacy option any more:

$ python setup.py install --enable-legacy
...
copying build/legacy-aliases/vo/__init__.py -> build/lib.macosx-10.8-x86_64-2.7/vo
Traceback (most recent call last):
  File "setup.py", line 101, in <module>
    **package_info
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "build/bdist.macosx-10.8-x86_64/egg/setuptools/command/install.py", line 73, in run
  File "build/bdist.macosx-10.8-x86_64/egg/setuptools/command/install.py", line 93, in do_egg_install
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "build/bdist.macosx-10.8-x86_64/egg/setuptools/command/bdist_egg.py", line 185, in run
  File "build/bdist.macosx-10.8-x86_64/egg/setuptools/command/bdist_egg.py", line 171, in call_command
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "build/bdist.macosx-10.8-x86_64/egg/setuptools/command/install_lib.py", line 20, in run
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install_lib.py", line 109, in build
    self.run_command('build_py')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/private/tmp/astropy/astropy/setup_helpers.py", line 586, in run
    SetuptoolsBuildPy.run(self)
  File "build/bdist.macosx-10.8-x86_64/egg/setuptools/command/build_py.py", line 89, in run
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_py.py", line 372, in build_packages
    self.build_module(module, module_file, package)
  File "build/bdist.macosx-10.8-x86_64/egg/setuptools/command/build_py.py", line 106, in build_module
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_py.py", line 333, in build_module
    "'package' must be a string (dot-separated), list, or tuple")
TypeError: 'package' must be a string (dot-separated), list, or tuple

This might be the same issue: http://bugs.python.org/issue13943

@astrofrog
Copy link
Member

I was just about to bring up the topic of --enable-legacy - specifically, do we actually still want to keep it? I actually would have no problems with getting rid of it before 0.3.0, as I don't think it's a widely known or used feature.

@mdboom
Copy link
Contributor

mdboom commented Sep 26, 2013

This was broken when wcs was converted to use six rather than 2to3.

In any event, I've attached a patch to fix the underlying bug.

I agree we should reopen the discussion about whether or not to continue to support the legacy wrappers, but in the meantime, we should probably fix this in case that discussion doesn't reach a conclusion before 0.3.

@astrofrog
Copy link
Member

@cdeil - can you confirm this fix works for you?

@cdeil
Copy link
Member Author

cdeil commented Sep 29, 2013

Yes, this fix works.

I tried to install this in a virtualenv and ran into an unrelated issue:

$ python setup.py install --enable-legacy
...
error: astropy/table/_np_utils.c: Could not find C file astropy/table/_np_utils.c for Cython file astropy/table/_np_utils.pyx when building extension astropy.table._np_utils. Cython must be installed to build from a git checkout
...
$ which python
/private/tmp/astropy/legacy/bin/python
$ which cython
/opt/local/bin/cython

cython is on the PATH, so the astropy build should use it, right?

@astrofrog
Copy link
Member

@cdeil - strange, and this occurs only with --enable-legacy?

@cdeil
Copy link
Member Author

cdeil commented Sep 29, 2013

@astrofrog No, I tested in fresh virtualenvs on Mac and Linux with astropy master: Cython has to be installed into the virtualenv, the astropy build doesn't use a system cython from the PATH.

Maybe this is the intended behaviour for astropy?
E.g. scikit-image also requires Cython installed in the virtualenv:

$ cd scikit-image
$ python setup.py install
Traceback (most recent call last):
  File "setup.py", line 105, in <module>
    check_requirements()
  File "setup.py", line 100, in check_requirements
    % ((package_name, ) + min_version))
ImportError: You need `Cython` version 0.17 or later.
$ cython --version
Cython version 0.19.1
$ python -c 'import Cython'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named Cython

@astrofrog
Copy link
Member

@cdeil - that is expected behavior, Cython has to be in the Python environment you are using, hence the virtual environment (the Python module has to be present, not just the command-line tool)

astrofrog added a commit that referenced this pull request Sep 29, 2013
Error with install --enable-legacy
@astrofrog astrofrog merged commit b832b7b into astropy:master Sep 29, 2013
@mdboom mdboom deleted the setup/fix-legacy branch May 21, 2014 23:56
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

Successfully merging this pull request may close these issues.

3 participants