Issue with Installing PyObjC for Python

帅比萌擦擦* 提交于 2020-08-08 06:28:16

问题


I was attempting to install PyObjC on my Mac OS X El Capitan, and about 40 minutes into the download, I received an error and it stopped. I tried installing using the following code in my terminal:

pip install pyobjc

The error says:

Command python setup.py egg_info failed with error code 1 in
/private/var/folders/6x/pl46qrrj2n51fs9z00cw46240000gn/T/pip_build_Dustin/pyobjc-framework
-AVKit
 Storing debug log for failure in /Users/Dustin/Library/Logs/pip.log

I am using Xcode Version 7.3 and have been searching online for some answers but have been unable to find anything that seems to help. Any suggestions as to how to get the download to complete?


回答1:


You are using Python 2.7, but from the logs, it appears as though you're trying to install pyobjc for a different version, most probably Python 3.

Line 267: pkg_resources.VersionConflict: (pyobjc-core 2.5.1 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC), Requirement.parse('pyobjc-core>=3.1.1'))

If you wish to use Python 3, use this method to install:

python3 -m pip install pyobj

Alternatively, I suggest you go ahead and download pyobjc from here, and install it manually from the source using this command:

  • For Python 2.7: python2.7 pyobjc/install.py
  • For Python 3.x: python3 pyobjc/install.py

The documentations here and here, clearly explain the installation process in further details. The latter deals with some possible problems, too.

Another alternative is to try easy_install:

python -m easy_install pyobjc

Note

Please ensure that you have commandline-tools from xcode installed before attempting to install pyobjc. Also, make sure that you run this in your terminal beforehand if you use Mac OS X 10.8 or lower.

 xcode-select --install.

Finally, it might be a good idea to install the core separately:

python2.7 -m pip install -U pyobjc-core
python2.7 -m pip install -U pyobjc

Lets try these and see if they work!




回答2:


Hey please make sure to check that you have installed these dependencies:

image==1.5.27
numpy==1.17.4
Pillow==6.2.1
requests==2.22.0
opencv-python
olefile==0.46
PyAutoGUI==0.9.48
PyMsgBox==1.0.7
pyobjc-core==6.2
pyobjc-framework-Cocoa==6.1
pyobjc-framework-Quartz==5.3
PyScreeze==0.1.26
PyScreeze==0.1.26
PyTweening==1.0.3
pathlib

Add these to your requirements.txt file and install with pip install -r requirements.txt

That should solve the problem. Also make sure that you are using python versions 3.6 and above



来源:https://stackoverflow.com/questions/36813269/issue-with-installing-pyobjc-for-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!