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
Unprivileged installations onto OS X don't support wheels even if a newer setuptools is installed #1480
Comments
Can you say what versions of setuptools OS Xs come with? |
|
Oddly enough, I've discovered that if I use the included |
pip 1.5.1 (to be released soon) will solve this, because it won't require 'setuptools>=0.8' for it's wheel support, so it will allow the older/global setuptools to be used. as for the sys.path modification you're seeing, that's the effect of easy_install. easy_install'd global packages override the user site. pip can't undo it, or fix it IMO. the solution is for OSX to not use easy_install the global setuptools. |
@qwcode The global setuptools does not appear to be |
@qwcode In fact,
|
what "sys.path-management shenanigans" are you referring to then? |
@qwcode I don't know! By the time |
paste your sys.path output with a new setuptools in the user site, if you won't mind |
If it's not easy_install, then all I can imagine would be a custom |
Default:
After installing
Going back to the beginning (deleting
|
actually, I mispoke, 1.5.1 drops the |
I've always assumed this was some Apple shenanigans shoving their own stuff first. |
I can't tell from the output where the global setuptools is at. I assume it's not in |
@qwcode Apparently there is, because |
Would it be helpful to you folks for me to get you access to a Mac? |
don't follow what you mean. specifically in your first paste (#1 out of the 3), I'm saying I don't know where setuptools is at, and it's not installed with easy_install per your earlier comments. |
|
ok, I guess your point is that upgrading setuptools globally with easy_install (your #3 case) is a solution. |
btw, I've added a stub for this case into the "Packaging User Guide" (https://python-packaging-user-guide.readthedocs.org/en/latest/platforms.html#installing-on-osx). we need OSX people to help fill out that section with cases like this. |
to be clear, the easy_install upgrade is working due to the way it modifies the sys.path with it's |
As far as I can tell this is fundamentally a problem with Apple's system python. The question then is do we want to provide a work around for this case or do we want to simply document the fact that Apple's system Python is installed like this? |
Assuming the problem we're talking about is that the user install of setuptools (via pip) has lower precedence than the default system install of setuptools, then I can't imagine what a workaround would be. If OSX has the user site lower in precedence to other system-managed paths (which contains setuptools), then what are we going to do? I can only imagine resorting to pth hacks like easy_install, but I don't think that's something we want to get into. |
@qwcode Why wouldn't you want to get into that? Writing out a single |
Note that I'm not saying you shouldn't report the bug with Apple and eventually get the issue fixed for real too, but there's a big "meanwhile" to be concerned about here. |
@qwcode Regarding an earlier comment you made; I'm upgrading setuptools "globally" in the sense that it's not in a virtualenv, but it's functionally equivalent to a |
ok, I pulled my macbook off the shelf, and I confirm everything you're reporting, except your 3rd case, when you say you upgraded setuptools with easy_install and you reported your sys.path as then containing: '/Users/glyph/Library/Python/2.7/lib/python/site-packages/setuptools-2.1-py2.7.egg' that's the user site. If I try the upgrade of setuptools with easy_install, it wants to write to |
so the logic would be something like this on OSX:
that's invasive, and it's hard think through what side-effects might arise. |
@qwcode This doesn't necessarily need to be fixed in pip proper; it could be something in |
@qwcode Also, yes, I specified the appropriate |
I don't see how we could fix this in |
I'm not actually too familiar with |
No, |
How does it presently install setuptools? |
Using normal pip means get-pip.py just has pip 1.5.1 bundled inside of it, it unzips to a temp directory and does a pip install of setuptools and pip. |
It seems like the issue is fixed with a regular |
I've worked around this in pip2014.com by dropping a
|
I'm not sure that is a suitable fix, but it's at least something to point in a decent direction. |
Why isn't it suitable? |
Won't that put the sitedir before "."? |
Apparently not, at least looking at my own Python install. |
Keep in mind this gets processed during the addition of sitedirs, not at the end of sys.path construction. |
This may not be practically relevant any more, since OS X now ships with setuptools 1.1.6, which is recent enough to allow for bootstrapping into something good. |
I agree it may not be precisely relevant, but I'm finding issues upgrading Setuptools in Mac OS X, such as reported in pypa/setuptools#738. Although 1.1.6 is light years better than 0.6, there are still applications that rely on |
Best I can tell, this guidance is no longer present, so I'm going to start from scratch. |
This is no longer an issue in macOS Sierra, normal installations into |
Mac OS X comes with an old version of setuptools pre-installed.
Unfortunately through some combination of
sys.path
-management shenanigans, this older version of setuptools tends to take precedence when importing, even if a user has explicitly donepip install --user --upgrade setuptools
. This means thatpip wheel
doesn't work.This is a problem if a user does not have privileged access to a system but wants to do some Python development there; or, if they do have privileged access to a system but take the wise precaution of not automatically using
sudo
when a person from the internet tells them to.If I add
install_requires=['setuptools>=0.8']
to pip'ssetup.py
, and then install it, then this problem goes away. However, now it hard depends on the new version of setuptools. I think maybe this is just the way things should be, because interoperating with the older version of setuptools doesn't seem to cause anything but heartache.pkg_resources
has some affordance for dealing with multiple versions of software installed on a system, of course, but it doesn't seem to be exposed in an obvious way. I can't seem to just callpkg_resources.require("a sensible version of setuptools")
; I have to set__requires__
to the sensible version ofsetuptools
in__main__
before even importingpkg_resources
.The text was updated successfully, but these errors were encountered: