-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
pip doesn't install PyObjC #11
Comments
For what I see, these packages rely on distribute. The use_2to3 is a You should try installing distribute, and them installing PyObjC again. I don't have a Mac here, so I cant try anything :( By the way, it does not look like a pip bug. Good luck!
|
I think the use_2to3 thing is a red herring here -- it's just a UserWarning, I have just run across this unhappy error on my Mac. I've tried poking at the https://sourceforge.net/tracker/?func=detail&aid=3195876&group_id=14534&atid= 4&atid=114534
|
If I remember the code rightly, this is probably two pip bugs. 1) pip uses an extreme hack to subclass egg_info itself, which will break other people trying to do that, and 2) pip runs each setup.py separately, reimporting setuptools each time, so the monkeypatches that were in the "first" setup.py unfortunately are not still in effect for the dependencies' setup.py files. This is a major difference between pip install and setup.py install. |
Hello, I tried to patch pyobjc's setup.py so that it can be installable with pip. I am NOT sure it is OK, this patch is just a clue:
I mean, this patch removes an action on some header files (I haven't understood what it does yet), but pip install doesn't fail any more. Now I'll try to use it :) |
Modifying setup.py seemed to work. but I am still not sure. Here is the sequence of commands I ran.
|
Actually I updated the patch to use the egg_info.run() override, and I think it is better:
Then you just run Hope that it works for you too! |
madprog's patch worked great for making the process actually get started. Thank you so much for posting that. It seems to lead me to a later error after the dependencies are downloaded, stating vaguely "running build_ext; error: Permission denied". No obvious tricks are resolving the issue. I can't even find the silly line that is responsible, because the command being executed is just a string, with temp files as build scripts and pip install records. I hesitate to get too far off the original problem, but here's what I end up with during the build phase:
These temp files do not exist after the installation aborts, but the temp files it chooses are obviously different every execution. I can't even begin to guess what part of that command is causing permission errors. Prefixing my initial command with sudo apparently doesn't go through deep enough to this string execution. |
I found where the problem is in build_ext.
I'll post more if I find a nice solution. |
superdave, were you able to find a nice solution to this? |
+1 bitten by this |
Is this really a bug in pip or is it because the |
@superdave Did you try |
It's not a bug in pip; as the Python maintainers explained, it's because Python attempts to build its extension modules with the GCC it was compiled with. Since the current version of Python was built with XCode 4.1, and XCode 4.2 and beyond get rid of the gcc-4.2 alias, it breaks. If CC=gcc-4.0 fixed the problem, I would have fixed it a lot faster. :-) When I managed to build PyOpenCL in a similar fashion, I had to adjust a whole bunch of environment variables (related to dynamic linking) that also had the compiler string built in; I eventually just gave up on PyObjC, but one of these days when I have more time, I'll take up the torch again. |
I was able to workaround by doing this: virtualenv env # setup the virtual env
source env/bin/activate
pip install pyobjc
#now it fails with pyobjc-core
# 1: update some permissions
chmod a+x env/build/pyobjc-core/libxml2-src/configure
chmod a+x env/build/pyobjc-core/libxml2-src/install-sh
# 2: do some find/replace
sed -i.bak 's/use_2to3 = True/use_2to3 = False/g' env/build/pyobjc-core/setup.py
# 3: install with the setup.py
pushd env/build/pyobjc-core/
python setup.py install
popd
# 4: retry the pyobjc install
pip install pyobjc then it worked. |
If folks could try the change in PR 584 (commit ea109a0) and report on whether it worked here, that might help with getting this old issue fixed. |
Great job, msabramo! |
* 'develop' of git://github.com/pypa/pip: Add HackedEggInfo test for the the fix for pypaGH-11. generate error in test same way as pip.req Fix incorrect mocking. Fix missing import in test. Fix failing windows test. Skip submodule testing on windows. Prevent assertion error from scripttest on windows. Fix failng windows tests. Fix failing bzr vcs test use nose.tools.assert_raises raise InstallationError when UninstallPathSet has no paths don't --user install in --system-site-packages virtualenvs with conflict Make magic use pkg_resources.iter_entry_points instead of relying on egg_info.iter_entry_points, which might not be there if someone redefines egg_info (like the setup.py for pyobjc-core does) non_hierarchical was dropped at the same time as uses_fragment (pypa#552) fix compatability w/3.3 & 2.7.4 & bazaar (pypa#552)
How does one go about fixing |
@mouseplatterman if you can, you should try what @msabramo mentioned above - it looks to be the best solution. |
Did that too -- got me to the build_ext error, which was corrected by running |
(for posterity:) |
@mouseplatterman Thanks for sharing your workaround; I posted it at https://sourceforge.net/tracker/?func=detail&aid=3195876&group_id=14534&atid=114534 so that the PyObjC folks can know about it. |
Hi,
I'm trying to install PyObjC with pip, it give following error message and it terminates.
Any suggestions please?
The text was updated successfully, but these errors were encountered: