pip installs scripts of wheels only into virtualenvs (OSX) #1240

Closed
hynek opened this Issue Oct 21, 2013 · 14 comments

Comments

Projects
None yet
4 participants
Contributor

hynek commented Oct 21, 2013

…and not into global site-packages.

A user reported that he can’t install doc2dash globally and it turned out it happens only for wheels. I’ve reported this error to wheel too but @dstufft tipped me off that it’s more likely a pip issue.

Platform is OS X, Python 2.7.5, pip 1.4.1 and wheel is 0.22 & tip.

Contributor

qwcode commented Oct 24, 2013

I didn't see this on linux (atleast for the wheel I built myself from the doc2dash sdist)
It installed the doc2dash script.

maybe post the wheel somewhere that you had posted on pypi (that you since removed)

as a side note, the requirement beautifulsoup4==4.1.3 won't be fulfilled unless the user specifically uses --allow-external

Contributor

qwcode commented Oct 24, 2013

just noticed your install instructions say pip install --user doc2dash.
we just fixed a bug for wheel scripts with the --user flag (#1163).
that fix has not been released yet.

Contributor

hynek commented Oct 24, 2013

Yeah, BS4 unfortunately removed a release. I’ve updated the requirements in the repo though and wanted to issue a new release as soon as the wheel problem is sorted out.

Aside from the --user issue, I investigated some more and yes: it’s totally an issue that happens only on OS X/homebrew.

While sdist creates the script in /usr/local/bin, pip puts scripts from wheels into /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/bin/ which you may or may not put into your own PATH. Not sure which one is more correct but I would have expected them to be consistent. As wheels get more popular, I’d expect more of such bug reports. :-/

Also the bug description is probably wrong but I’m not sure how to rephrase it.

Owner

dstufft commented Nov 2, 2013

Confirmed this is still happening with the latest dev.

I may not understand the issue here but one of the advantages of using a Python framework install on OS X is that each framework has its own bin directory where executables and scripts get installed. The preferred way to manage access to them is to add the fw bin directory to your shell PATH. If you want to override it for some reason, you should be able to change the installation location by using .pydistutils.cfg. pip should not override the Distutils settings. An installation using setup.py or using pip should give the same results. You can query the settings with sysconfig.get_path().

Owner

dstufft commented Nov 2, 2013

My concern is with the difference in behavior. Need to sort out why there is a difference, who is different, what it should be, what it is, and what the right fix is.

I suspect distutils or setup tools might be doing something wrong when it installs scripts which nobody noticed until Wheel did it right and there was a difference in behavior. If that is the case the question becomes do we do what's right or do we stick with the defacto standard.

I plan on doing more investigation when I get home.

On Nov 2, 2013, at 2:36 PM, ned-deily notifications@github.com wrote:

I may not understand the issue here but one of the advantages of using a Python framework install on OS X is that each framework has its own bin directory where executables and scripts get installed. The preferred way to manage access to them is to add the fw bin directory to your shell PATH. If you want to override it for some reason, you should be able to change the installation location by using .pydistutils.cfg. pip should not override the Distutils settings. An installation using setup.py or using pip should give the same results. You can query the settings with sysconfig.get_path().


Reply to this email directly or view it on GitHub.

I've just been playing with it and as far as I can tell Wheel is doing it wrong. At least Wheel is not taking into account the settings in Distutils config files. pip install from a non-wheel works as I would expect: I can override the script installation location with, for example, .pydistutils.cfg. That is the same behavior as setuptools and plain Distutils. pip install from a wheel appears to always install into the default locations. To be specific, I was installing docutils with the following contents in ~/.pydistutils.cfg:

[install]
install-scripts=/tmp/a/bin

The Distutils configuration files are documented here: http://docs.python.org/3/install/index.html#distutils-configuration-files

Contributor

qwcode commented Nov 2, 2013

pip is using the install and Distribution class directly from distutils for the wheel install scheme logic. Just noticed though we are not calling the Distribution.parse_config_files function (which distutils runs as part of setup()). As of yet, have NOT gotten it to pick up an override from a pydistutils.cfg file. will look at this more later.

Owner

dstufft commented Nov 2, 2013

So here's what I think we should do.

Now Timeframe

Make this work with ~/.distutils.cfg even though it makes installing Wheels dependent on distutils.

Python 3.5+ Timeline

Introduce a PEP to make distutils use sysconfig, introduce a ~/.sysconfig.cfg which supports ~/.distutils.cfg as a backwards compat thing.

Owner

dstufft commented Nov 2, 2013

Also /cc @ncoghlan

Contributor

qwcode commented Nov 5, 2013

Make this work with ~/.distutils.cfg even though it makes installing Wheels dependent on distutils.

I have this working locally now. I'll post a PR tomorrow.

Contributor

qwcode commented Nov 5, 2013

PR #1297

Contributor

qwcode commented Nov 7, 2013

can someone on a mac test now with develop branch?

Owner

dstufft commented Nov 7, 2013

Tested and confirmed working.

dstufft closed this Nov 7, 2013

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