Skip to content

pip install fails with missing numpy #60

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
zjttoefs opened this issue Jun 19, 2015 · 12 comments
Closed

pip install fails with missing numpy #60

zjttoefs opened this issue Jun 19, 2015 · 12 comments

Comments

@zjttoefs
Copy link

There is a obvious workaround.
I'm playing with some fresh virtual machines and would prefer nexpy handling at least the mandatory dependencies.

@rayosborn
Copy link
Contributor

Is it that pip is unable to install numpy when it encounters the dependency?

@zjttoefs
Copy link
Author

It does not appear to make any attempt at installing a dependency:


$ pip install nexpy
Downloading/unpacking nexpy
Downloading NeXpy-0.5.4.tar.gz (1.5MB): 1.5MB downloaded
Running setup.py (path:/tmp/pip-build-8hOZDz/nexpy/setup.py) egg_info for package nexpy
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip-build-8hOZDz/nexpy/setup.py", line 14, in
pkg_resources.require('numpy')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 745, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 639, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: numpy
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 17, in

File "/tmp/pip-build-8hOZDz/nexpy/setup.py", line 14, in

pkg_resources.require('numpy')

File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 745, in require

needed = self.resolve(parse_requirements(requirements))

File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 639, in resolve

raise DistributionNotFound(req)

pkg_resources.DistributionNotFound: numpy


Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-8hOZDz/nexpy
Storing debug log for failure in /home/vagrant/.pip/pip.log
$


@prjemian
Copy link
Contributor

How can this be a failure of NexPy?
On Jun 19, 2015 8:11 AM, "Tobias Richter" [email protected] wrote:

It does not appear to make any attempt at installing a dependency:

$ pip install nexpy
Downloading/unpacking nexpy
Downloading NeXpy-0.5.4.tar.gz (1.5MB): 1.5MB downloaded
Running setup.py (path:/tmp/pip-build-8hOZDz/nexpy/setup.py) egg_info for
package nexpy
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip-build-8hOZDz/nexpy/setup.py", line 14, in
pkg_resources.require('numpy')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 745, in
require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 639, in
resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: numpy
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 17, in

File "/tmp/pip-build-8hOZDz/nexpy/setup.py", line 14, in

pkg_resources.require('numpy')

File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 745, in
require

needed = self.resolve(parse_requirements(requirements))

File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 639, in
resolve

raise DistributionNotFound(req)

pkg_resources.DistributionNotFound: numpy

Cleaning up...
Command python setup.py egg_info failed with error code 1 in
/tmp/pip-build-8hOZDz/nexpy
Storing debug log for failure in /home/vagrant/.pip/pip.log

$


Reply to this email directly or view it on GitHub
#60 (comment).

@danielballan
Copy link

Writing a bulletproof setup.py is always messy and virtually impossible. Has anyone packaged nexpy for conda? That might be the easiest way to get running quickly on virtual machines. If there is interest I can take a look at this.

@rayosborn
Copy link
Contributor

I would be delighted if you were able to get a conda package set up. The popularity of conda was one of the most important reasons for making NeXpy compatible with PyQt, so it's on my to-do list. Not sure why pip wouldn't just install numpy though, since it is clearly listed as a dependency.

@danielballan
Copy link

My understanding is that installation-time dependencies (as opposed to runtime dependencies) cannot be automatically installed by pip/setuptools. This is -- if I understand correctly -- a limitation of setuptools. The best you can do is fail informatively, which nexpy is doing.

@tacaswell
Copy link
Contributor

There are ways to setup tools to cleanly install other things first, matplotlib does this, but it requires cajoling. See https://pythonhosted.org/setuptools/setuptools.html#new-and-changed-setup-keywords and setup_requires.

zjttoefs added a commit that referenced this issue Jun 19, 2015
That should fix the build dependency problem #60
@zjttoefs
Copy link
Author

Just adding a setup_requires didn't do the trick. I made the change on a branch and tried:

pip install git+git://github.com/nexpy/nexpy.git@zjttoefs-issue-60

It still fails on the same line. I must admit I have a very bare understanding of setuptools but I don't quite get why the setup needs (imports) numpy (and nexpy).

@tacaswell
Copy link
Contributor

@zjttoefs Your not alone 😉

@zjttoefs
Copy link
Author

Thanks @tacaswell !
Okay, I understand those imports now. Removing them requires some extra work, that is neatly avoided by using them.
Maybe stealing a bit from matplotlib would be good.

@rayosborn
Copy link
Contributor

I'm all in favor of raiding matplotlib whenever possible. I won't have time to look into this for a week or so, but will be happy to consider pull requests. By the way, I had to remove PySide from the dependency list in order to allow PyQt4 or 5-only installations. I don't know if there is any way of handling these kinds of dependencies better.

@tacaswell
Copy link
Contributor

As a warning, mpl's setup.py grew organically through multiple generations
of setup tools and has a lot of cruft (that at least I don't understand
well enough to be willing to touch).

h5py might be a better template.

On Fri, Jun 19, 2015 at 11:08 AM Ray Osborn [email protected]
wrote:

I'm all in favor of raiding matplotlib whenever possible. I won't have
time to look into this for a week or so, but will be happy to consider pull
requests. By the way, I had to remove PySide from the dependency list in
order to allow PyQt4 or 5-only installations. I don't know if there is any
way of handling these kinds of dependencies better.


Reply to this email directly or view it on GitHub
#60 (comment).

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

No branches or pull requests

5 participants