8000 Numpy as setuptools dependency (Trac #860) · Issue #1458 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Numpy as setuptools dependency (Trac #860) #1458

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

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 13 comments
Closed

Numpy as setuptools dependency (Trac #860) #1458

numpy-gitbot opened this issue Oct 19, 2012 · 13 comments

Comments

@numpy-gitbot
Copy link

Original ticket http://projects.scipy.org/numpy/ticket/860 on 2008-07-24 by trac user phsilva, assigned to @dmcooke.

Numpy 1.1.0 works well with easy_install if called from command line, like:

easy_install numpy==1.1.0

BUT, if I declare numpy==1.1.0 as a dependency in my setup.py setup() function, then I got this error (actually I get the same errors with Numpy 1.0.4):

Traceback (most recent call last):
File "setup.py", line 116, in
platforms = chimera_platform)
File "/usr/lib/python2.5/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.5/distutils/dist.py", line 974, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.5/distutils/dist.py", line 994, in run_command
cmd_obj.run()
File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/command/develop.py", line 27, in run
File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/command/develop.py", line 102, in install_for_development
File "/usr/lib/python2.5/site-packages/easy_install.py", line 519, in process_distribution

File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 522, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 758, in best_match
return self.obtain(req, installer) # try and download/install
File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 770, in obtain
return installer(requirement)
File "/usr/lib/python2.5/site-packages/easy_install.py", line 446, in easy_install

File "/usr/lib/python2.5/site-packages/easy_install.py", line 476, in install_item

File "/usr/lib/python2.5/site-packages/easy_install.py", line 655, in install_eggs

File "/usr/lib/python2.5/site-packages/easy_install.py", line 930, in build_and_install

File "/usr/lib/python2.5/site-packages/easy_install.py", line 919, in run_setup

File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/sandbox.py", line 27, in run_setup
File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/sandbox.py", line 63, in run
File "/usr/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/setuptools/sandbox.py", line 29, in
File "setup.py", line 96, in
"numpy == 1.1.0",
File "setup.py", line 89, in setup_package
"Elixir >= 0.5.2",
File "/tmp/easy_install-kOtWpP/numpy-1.1.0/numpy/distutils/core.py", line 150, in setup
File "setup.py", line 56, in configuration
# setup
File "/tmp/easy_install-kOtWpP/numpy-1.1.0/numpy/distutils/misc_util.py", line 839, in add_subpackage
File "/tmp/easy_install-kOtWpP/numpy-1.1.0/numpy/distutils/misc_util.py", line 822, in get_subpackage
File "/tmp/easy_install-kOtWpP/numpy-1.1.0/numpy/distutils/misc_util.py", line 769, in _get_configuration_from_setup_py
File "/home/henrique/work/chimera/chimera/setup.py", line 9, in configuration
# as published by the Free Software Foundation; either version 2
File "/tmp/easy_install-kOtWpP/numpy-1.1.0/numpy/distutils/misc_util.py", line 839, in add_subpackage
File "/tmp/easy_install-kOtWpP/numpy-1.1.0/numpy/distutils/misc_util.py", line 822, in get_subpackage
File "/tmp/easy_install-kOtWpP/numpy-1.1.0/numpy/distutils/misc_util.py", line 769, in _get_configuration_from_setup_py
File "/home/henrique/work/chimera/chimera/setup.py", line 223, in configuration

File "/tmp/easy_install-kOtWpP/numpy-1.1.0/numpy/distutils/misc_util.py", line 1039, in add_include_dirs
AttributeError: 'NoneType' object has no attribute 'extend'

This seems similar to issue #679. Numpy distutils was expecting something which setuptools distutils (only in dependency mode) overrides and throw away.

Follows a patch/hack against 1.1.0 that worked to me (for 1.0.4 it's just the same hack on different chunck).

What the plan for distutils based installers (like setuptools) when numscons became the default? I'm not going to integrate my package in distribution yet, so I'm using easy_install which seems to be the easiest solution available. Any other idea about how to distribute Numpy? I was thinking about try to create an egg, but then I'll need to have one for each different setup (distro/arch) that I would like to use, right?

Thanks a lot, and congrats for the great work with Numpy!

@numpy-gitbot
Copy link
Author

Attachment added by trac user phsilva on 2008-07-24: patch-numpy-1.1.0

@numpy-gitbot
Copy link
Author

@charris wrote on 2008-07-24

There have been some modifications to this file and others for 1.1.1 (and trunk). Can you check if the problem persists?

@numpy-gitbot
Copy link
Author

trac user phsilva wrote on 2008-07-24

Replying to [comment:1 charris]:

There have been some modifications to this file and others for 1.1.1 (and trunk). Can you check if the problem persists?

Problem persist in trunk and numpy 1.1.1rc2.

@numpy-gitbot
Copy link
Author

trac user phsilva wrote on 2008-10-30

Guys,

can you please take a look at this bug? its just one line patch and the "bug" persists in 1.2.1.

Cheers,

@numpy-gitbot
Copy link
Author

trac user ceball wrote on 2009-10-01

Just wondering if there's any news about this? numpy 1.3 also doesn't seem to work as a dependency:

Searching for numpy>=1.2.0
Reading http://pypi.python.org/simple/numpy/
Reading http://numpy.scipy.org
Reading http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103
Reading http://numeric.scipy.org
Best match: numpy 1.3.0
Downloading http://pypi.python.org/packages/source/n/numpy/numpy-1.3.0.tar.gz#md5=3f7773ff0971a5ebb8591536d8ec7bd6
Processing numpy-1.3.0.tar.gz
Running numpy-1.3.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-YGhFfC/numpy-1.3.0/egg-dist-tmp-AAajUT
Running from numpy source directory.
Warning: distutils distribution has been initialized, it may be too late to add a subpackage command
Warning: distutils distribution has been initialized, it may be too late to add a subpackage fcompiler
non-existing path in 'numpy/distutils': 'site.cfg'
Warning: distutils distribution has been initialized, it may be too late to add a subpackage distutils
Warning: distutils distribution has been initialized, it may be too late to add a subpackage testing
Warning: distutils distribution has been initialized, it may be too late to add a subpackage f2py
Traceback (most recent call last):
  File "setup_ez.py", line 48, in <module>
    **_setup.common
  File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.6/dist-packages/setuptools/command/develop.py", line 27, in run
    self.install_for_development()
  File "/usr/lib/python2.6/dist-packages/setuptools/command/develop.py", line 102, in install_for_development
    self.process_distribution(None, self.dist, not self.no_deps)
  File "/usr/lib/python2.6/dist-packages/setuptools/command/easy_install.py", line 537, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 522, in resolve
    dist = best[req.key] = env.best_match(req, self, installer)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 758, in best_match
    return self.obtain(req, installer) # try and download/install
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 770, in obtain
    return installer(requirement)
  File "/usr/lib/python2.6/dist-packages/setuptools/command/easy_install.py", line 464, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python2.6/dist-packages/setuptools/command/easy_install.py", line 494, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python2.6/dist-packages/setuptools/command/easy_install.py", line 673, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python2.6/dist-packages/setuptools/command/easy_install.py", line 948, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python2.6/dist-packages/setuptools/command/easy_install.py", line 937, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python2.6/dist-packages/setuptools/sandbox.py", line 27, in run_setup
    lambda: execfile(
  File "/usr/lib/python2.6/dist-packages/setuptools/sandbox.py", line 63, in run
    return func()
  File "/usr/lib/python2.6/dist-packages/setuptools/sandbox.py", line 29, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 172, in <module>

  File "setup.py", line 165, in setup_package

  File "/tmp/easy_install-YGhFfC/numpy-1.3.0/numpy/distutils/core.py", line 150, in setup
  File "setup.py", line 128, in configuration

  File "/tmp/easy_install-YGhFfC/numpy-1.3.0/numpy/distutils/misc_util.py", line 852, in add_subpackage
  File "/tmp/easy_install-YGhFfC/numpy-1.3.0/numpy/distutils/misc_util.py", line 835, in get_subpackage
  File "/tmp/easy_install-YGhFfC/numpy-1.3.0/numpy/distutils/misc_util.py", line 782, in _get_configuration_from_setup_py
  File "numpy/setup.py", line 9, in configuration
    from distutils.core import setup
  File "/tmp/easy_install-YGhFfC/numpy-1.3.0/numpy/distutils/misc_util.py", line 852, in add_subpackage
  File "/tmp/easy_install-YGhFfC/numpy-1.3.0/numpy/distutils/misc_util.py", line 835, in get_subpackage
  File "/tmp/easy_install-YGhFfC/numpy-1.3.0/numpy/distutils/misc_util.py", line 782, in _get_configuration_from_setup_py
  File "numpy/core/setup.py", line 443, in configuration

  File "/tmp/easy_install-YGhFfC/numpy-1.3.0/numpy/distutils/misc_util.py", line 1054, in add_include_dirs
AttributeError: 'NoneType' object has no attribute 'extend'

@numpy-gitbot
Copy link
Author

trac user tdavis wrote on 2010-01-19

This issue remains as of numpy 1.4.0 ...

File "/tmp/easy_install-KvJj5w/numpy-1.4.0/numpy/distutils/misc_util.py", line 1668, in add_scripts
AttributeError: 'NoneType' object has no attribute 'extend'

@numpy-gitbot
Copy link
Author

trac user phsilva wrote on 2010-01-19

C'mon guys, say WONTFIX or fix it, please. More than year and a half with this one line bug open and not a single statement about it.

@numpy-gitbot
Copy link
Author

@charris wrote on 2010-01-19

Send a heads up to the mailing list.

@numpy-gitbot
Copy link
Author

@cournape wrote on 2010-01-20

Sandbox issues in setuptools are complicated. It is also difficult to reproduce, and easy_install is deprecated anyway.

@numpy-gitbot
Copy link
Author

trac user phsilva wrote on 2010-01-20

Thanks for the answer. Are you guys going to support Distribute and pip?

I'm instructing people to just use whatever tool their distribution provides (apt, rpm) to install numpy anyway. setuptools was soo complicated with large packages that have custom distutils.

@numpy-gitbot
Copy link
Author

@cournape wrote on 2010-01-20

I am afraid we will have to support Distribute, yes. pip should cause less issues than easy_install, because it uses sources and not eggs. If you have issue with pip, please report them.

Using the distribution packages is certainly a good advice - distutils/setuptools is a clusterfuck, and as long as a better solution is not adopted, those issues will persist.

@numpy-gitbot
Copy link
Author

trac user phsilva wrote on 2010-01-20

Thanks. You can close this issue if you want . I'll stay with distro installers for now and when/if I port my system to pip I'll report any issue I found.

@numpy-gitbot
Copy link
Author

@rgommers wrote on 2010-12-12

This issue was fixed in 5dc876d (no guarantee that easy_install works though)

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

No branches or pull requests

1 participant
0