Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with Installing PyObjC for Python

Tags:

python

pyobjc

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?

like image 838
djl Avatar asked Oct 23 '25 17:10

djl


2 Answers

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!

like image 158
Pouria Avatar answered Oct 26 '25 05:10

Pouria


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

like image 41
Godspower Avatar answered Oct 26 '25 06:10

Godspower



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!