简体   繁体   中英

Permission denied error installing Pillow (PIL) on mac

I'm attempting to install the Pillow fork of PIL, and every method I've tried results in this error:

unable to execute /: Permission denied

error: command '/' failed with exit status 1

This occurs

  1. using pip install Pillow
  2. using easy_install Pillow-master.zip
  3. using python setup.py install
  4. using python setup.py build

The last is the most confusing to me, honestly. I can't even build the module in the same directory it's been extracted to.

I've made sure to install all of the prereqs using homebrew, just as the Pillow readme suggests.

This error has not occurred when installing other python modules.

Edit: I have run all of these commands with and without sudo.

I'm assuming you've solved the problem by now. If you haven't, you can now install pillow using brew by going

brew install samueljohn/python/pillow .

Why it isn't just brew install pillow is beyond me.

I am a newbie, I tried everything you did for the last 24 hours... Then I did the following

  1. I installed Xcode and then installed Command line tools (Go to Xcode preference menu, click on downloads, select and install command line).

  2. I then installed brew (I had been using macports and I kept getting some permission errors)

  3. this is the surprising bit.. I then tried using:

    easy_install pillow

and it worked, no more errors... I have no idea if step 1 and 2 above had anything to do with step 3 working, or its because I stopped trying to install PIL and instead went for pillow but its now working.

So what am I saying, try using easy_install pillow read more about pillow here ( http://www.pythonforbeginners.com/modules-in-python/how-to-use-pillow/ )

Good luck, let me know if it works.. if anyone has any idea why mine worked as well, let me know.

Jan 2021 Mac OS Big Sur 11.1 brew install samueljohn fails ...

brew install samueljohn/python/pillow
==> Tapping samueljohn/python
Cloning into '/usr/local/Homebrew/Library/Taps/samueljohn/homebrew-python'...
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/samueljohn/homebrew-python/'
Error: Failure while executing; `git clone https://github.com/samueljohn/homebrew-python /usr/local/Homebrew/Library/Taps/samueljohn/homebrew-python` exited with 128.

看起来您已经激活了虚拟环境,在这种情况下,您必须运行以下 cmd

sudo python -m pip install Pillow

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM