Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing pyobjc on a Mac

I am facing problems installing pyobjc on my mac.
Basically I have to install pyobjc on a new Mac System in the system default python. I have so far tried easy_install, pip and downloading the pkg file and installing. All give me a error in different ways. Some give me a error saying certain safari files are missing other cant due to some permission being denied even though I am running them through sudo su.
I then found a fix.

    pip install pyobjc --user

This worked and I could access all the modules I required, but then if I try running python through sudo, I cant access those modules.
Can anyone suggest a fix for this.

NOTE: I don't mind a different method to install also. Also I have not tried brew due to some previous difficulties with it.

NOTE 2: I need to be able to access those modules using all users on the computer, the root user and me(the non-root user)

like image 488
ShdwKnght333 Avatar asked Jul 10 '26 03:07

ShdwKnght333


1 Answers

i had to (temporarily) move (using sudo) /Library/Python/2.7/site-packages/Extras.pth to another name before I could install the current pyobjc.

This is what works for me:

sudo mv /Library/Python/2.7/site-packages/Extras.pth /Library/Python/2.7/site-packages/Extras.pth_orig
pip install --upgrade pyobjc
sudo mv /Library/Python/2.7/site-packages/Extras.pth_orig /Library/Python/2.7/site-packages/Extras.pth

It appears that something in the .pth file interferes with the install, but does not impede running pyobjc.

like image 148
cco Avatar answered Jul 13 '26 16:07

cco



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!