Installing Pillow/PIL on Mavericks

时光毁灭记忆、已成空白 提交于 2019-11-28 05:57:51
jussi

I solved that problem the following way. Propably has something to do with todays Mavericks commandline tools update. Try adding following to the terminal before executing pip install:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

Run this command in the terminal:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pillow


More info:

The compiler that comes with Xcode 5.1 treats unknown passed parameters as errors.

We're telling it to ignore those "errors"

source: http://bruteforce.gr/bypassing-clang-error-unknown-argument.html

In addition to @jussi, I had to open terminal and do the following:

    sudo bash
    export CFLAGS=-Qunused-arguments
    export CPPFLAGS=-Qunused-arguments

Only then could properly run 'pip install pillow'

If I didn't run this using a superuser prompt, I would get the following error:

    error: could not create '/Library/Python/2.7/site-packages/PIL': Permission denied

I'm running OSX 10.9.2 with the March 2014 Command Line Tools installed. I also have Homebrew installed if that makes a difference.

Check out brew http://brew.sh

brew tap Homebrew/python
brew install pillow

None of these solutions worked for me. I finally got it installed with help from this post:

I find the same issue trying to build MySQLdb with the latest Xcode and OS updates. Here is a work around that involves removing the flag from the python installation.

In /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.py are several places where the -mno-fused-madd flag is set. If you edit this file and remove all of the references to that flag your compilation should work. You need to delete the corresponding _sysconfigdata.pyc file as well - at least on my system that file did not automatically get rebuilt. Note that have to use root access to make those changes.

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