Mac OS X 10.9 이후 PIL을 설치할 수 없습니다
방금 Mac OS를 10.9로 업데이트했으며 일부 (모두?) Python 모듈이 더 이상 여기에 있지 않다는 것을 발견했습니다. 특히 이미지 모듈.
따라서을 실행하려고 sudo pip install pil
하지만이 오류가 발생합니다.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found
# include <X11/Xlib.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
내 Xcode가 최신 상태이며 아무 생각이 없습니다. PIL이 아직 10.9와 호환되지 않을 수 있습니까?
다음은 나를 위해 일했습니다.
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 /usr/local/include/X11
sudo pip install pil
최신 정보:
그러나 Will이 제공하는 더 정확한 해결책이 아래에 있습니다.
터미널을 열고 다음을 실행하십시오.
xcode-select --install
터미널을 열고 다음을 실행하십시오.
xcode-select --install
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/ /usr/local/include/X11
나를 위해 도와주세요! OS x 10.9
pip install pillow
그러나! pip 설치 후 ...
*** ZLIB (PNG/ZIP) support not available
마지막으로 다음을 실행하여 수정합니다.
xcode-select --install
그런 다음 베개를 다시 설치하십시오.
pip install pillow
PIL SETUP SUMMARY
--------------------------------------------------------------------
version Pillow 2.2.1
platform darwin 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- TIFF G3/G4 (experimental) support available
--- FREETYPE2 support available
--- LITTLECMS support available
--- WEBP support available
--- WEBPMUX support available
--------------------------------------------------------------------
나를 위해 작동합니다 (OS X Yosemite 10.10.2-Python 2.7.9).
xcode-select --install
sudo pip install pillow
이것을 확인하여보십시오 :
from PIL import Image
image = Image.open("file.jpg")
image.show()
여기 내가 한 일이 있습니다 .PIL에만 일부 단계가 필요하지는 않지만 어쨌든 libpng 및 기타가 필요했습니다.
1) xcode install을 실행하고이 명령을 사용하거나 앱 스토어에서 업데이트를 다운로드하십시오.
xcode-select --install
1b) Add the Command Line Tools optional tool, in Mountain Lion this was an option on the xcode Download page, but now you have to register with your apple id and download from: https://developer.apple.com/downloads/
Look for Command Line Tools (OS X Mavericks) for Xcode
2) Install everything needed for python (using brew), I believe you can use port as well:
brew install readline sqlite gdbm
brew install python --universal --framework
brew install libpng jpeg freetype
Unlink/ relink if needed i.e. if upgrading.
3) Install Pip and required modules:
easy_install pip
sudo pip install setuptools --no-use-wheel --upgrade
4) Finally this works with no errors:
sudo pip install Pillow
UPDATE 11/04/14: PIL repo no longer receives updates or support so Pillow should be used. The below is now deprecated so stick with Pillow.
sudo pip install pil --allow-external pil --allow-unverified pil
UPDATE (OLD) : The same thing applies when installing Pillow (PIL fork) and should be mentioned as its quickly becoming a replacement in most cases of PIL. Instead of installing pip in step 4, run this instead:
sudo pip install Pillow
Hope this helps someone!
installing command line tools fixed the issue for me
you have to install them separately as they are not part of the packages in xcode now:
https://developer.apple.com/downloads/index.action?=command%20line%20tools#
Non of those worked for me.. I kept receiving:
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
So I found a work around with the following solution:
sudo export CFLAGS=-Qunused-arguments
sudo export CPPFLAGS=-Qunused-arguments
sudo pip install PIL --allow-external PIL --allow-unverified PIL
This way I was able to install.
I had a similar problem: Installing pillow failed with clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
, installing command line tools failed with Can't install the software because it is not currently available from the Software Update server.
, and even after installing the command line tools manually, the compilation of PIL failed.
This happens cause clang under the newest version of xcode doesn't warn on unknown compiler flags, but rather stop the compilation with a hard error.
To fix this, just run export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
on the terminal before trying to compile (installing pil).
Simply run
pip install pil --allow-external pil --allow-unverified pil
This my steps on mac os 10.9.1
1. sudo su
2. easy_install pip
3. xcode-select --install
4. pip install --no-index -f http://dist.plone.org/thirdparty/ -U PIL
You could use Homebrew to do the install http://brew.sh
brew tap Homebrew/python
brew install pillow
Make sure you have Command Line Tools installed on your xcode. Then execute:
sudo pip install pil --allow-external pil --allow-unverified pil
I was having the following error
building 'PIL._imagingft' extension
_imagingft.c:62:10: fatal error: 'freetype/fterrors.h' file not found
#include <freetype/fterrors.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
The solution to this was to symlink freetype2 to freetype and this solved the problem.
I didn't want to install XCode (I don't use it) and I'm loath to fiddle with Application directory. I've cribbed from the many answers in this post and the following two steps work for me with 10.9.5:
sudo easy_install pip
sudo pip install pillow
It did appear to me strange that I had to use easy_install to install pip. But pip didn't want to work for me before that (re-)install.
Found the solution ... You've to symlink X11 like this ln -s /opt/X11/include/X11 /usr/local/include/X11
and then sudo pip install pil
should work.
Reusing @DmitryDemidenko's answer that is how it worked for me:
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 /usr/local/include/X11
and then
sudo pip install -U PIL --allow-external PIL --allow-unverified PIL
Execute the bellow command lines. Works like a charm on Mac OS 10.9.5
easy_install pip
sudo pip install setuptools --no-use-wheel --upgrade
sudo pip install Pillow
Best, Theo
That's what I did:
First upgrade to Xcode 5 (I am running 10.9). Then, execute the following commands in a terminal:
$ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
$ ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 usr/include/
A more complete solution requires the installation of the Xquartz X11 subsystem that has been built outside of Apple for several years now. Here are the steps I used to get it all working
- Install XQuartz from http://xquartz.macosforge.org/landing/
- Run
sudo pip install pillow
Had the same issue after update to 10.9 and fixed the error "command 'cc' failed with exit status 1" with this:
sudo sed -i '' -e 's/-mno-fused-madd//g' /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.py
sudo rm /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.pyc
pip install pillow
As the accepted answer is the right one with xcode-select --install
but some people (including me) may encounter Can't install the software because it is not currently available from the Software Update server
If you are using beta software (as I am using Yosemite now and had the same problem) you NEED to get the CLT separately since it is NOT included in XCode (even xcode beta) Head over to developers.apple.com and get CLT tools for your OS ;)
P.S. You don't need XQuartz for PIL or Pillow to work
My machine which was recently upgraded from OS 10.8 -> 10.9 got stuck in a loop between xcrun and lipo.
Rename /usr/bin/lipo to /usr/bin/lipo_broken
Refer to this thread for further information on how to resolve:
xcrun/lipo freezes with OS X Mavericks and XCode 4.x
Install Pillow instead:
sudo pip install pillow
ln -s /usr/local/include/freetype2 /usr/local/include/freetype
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pil
Try this:
ln -s /usr/local/include/freetype2 /usr/local/include/freetype
sudo pip uninstall pillow
pip install pillow
worked for me. I'm running Python 2.7.9 on Yosemite.import PIL
now works for me.
Installing PIL (Imaging.1.1.7) on Mac OSC 10.10 Yosemite. I tried numerous fixes recommended here but ran into trouble with each one. I finally solved this problem by editing the setup.py file such that:
TCL_ROOT = "/opt/X11/include"
which passes the appropriate include path for X11 in the compilation of _imagingtk.c, which was causing the problem for me. Worked immediately after change.
I've moved from pyenv
to virtualenv
and this fixed my problem.
- ln -s /opt/X11/include/X11 /usr/local/include/X11
- pip install pil without sudo
참고URL : https://stackoverflow.com/questions/19532125/cant-install-pil-after-mac-os-x-10-9
'Programing' 카테고리의 다른 글
파이썬에서 행렬 전치 (0) | 2020.06.28 |
---|---|
PHP json_encode 인코딩 숫자를 문자열로 (0) | 2020.06.28 |
JavaScript를 트리거하는 링크를 클릭 할 때 웹 페이지가 맨 위로 스크롤되지 않도록하려면 어떻게합니까? (0) | 2020.06.28 |
이름으로 쿠키를 삭제 하시겠습니까? (0) | 2020.06.28 |
Python sqlite3 API를 사용하는 테이블, db 스키마, 덤프 등의 목록 (0) | 2020.06.28 |