use*_*710 317 python installation pip python-imaging-library python-2.7
我正在尝试使用以下命令安装PIL(Python Imaging Library):
sudo pip install pil
Run Code Online (Sandbox Code Playgroud)
但我收到以下消息:
Downloading/unpacking PIL
You are installing a potentially insecure and unverifiable file. Future versions of pip will default to disallowing insecure files.
Downloading PIL-1.1.7.tar.gz (506kB): 506kB downloaded
Running setup.py egg_info for package PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
Installing collected packages: PIL
Running setup.py install for PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.8-intel-2.7/_imaging.o
unable to execute clang: No such file or directory
error: command 'clang' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;__file__='/private/tmp/pip_build_root/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-AYrxVD-record/install-record.txt --single-version-externally-managed:
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
running install
running build
.
.
.
.
copying PIL/XVThumbImagePlugin.py -> build/lib.macosx-10.8-intel-2.7
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
creating build/temp.macosx-10.8-intel-2.7
creating build/temp.macosx-10.8-intel-2.7/libImaging
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.8-intel-2.7/_imaging.o
unable to execute clang: No such file or directory
error: command 'clang' failed with exit status 1
----------------------------------------
Cleaning up…
Run Code Online (Sandbox Code Playgroud)
你能帮我安装PIL吗?
Fog*_*ird 537
https://pypi.python.org/pypi/Pillow/2.2.1
pip install Pillow
Run Code Online (Sandbox Code Playgroud)
如果你安装了两个Pythons并想为Python3安装它:
python3 -m pip install Pillow
Run Code Online (Sandbox Code Playgroud)
mad*_*rdi 60
这对我有用:
apt-get install python-dev
apt-get install libjpeg-dev
apt-get install libjpeg8-dev
apt-get install libpng3
apt-get install libfreetype6-dev
ln -s /usr/lib/i386-linux-gnu/libfreetype.so /usr/lib
ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib
ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib
pip install PIL --allow-unverified PIL --allow-all-external
Run Code Online (Sandbox Code Playgroud)
Jay*_*kar 54
使用apt install非常简单,使用此命令来完成它
sudo apt-get install python-PIL
Run Code Online (Sandbox Code Playgroud)
要么
sudo pip install pillow
Run Code Online (Sandbox Code Playgroud)
要么
sudo easy_install pillow
Run Code Online (Sandbox Code Playgroud)
小智 35
在Mac OS X上,使用此命令:
sudo pip install https://effbot.org/media/downloads/Imaging-1.1.7.tar.gz
Run Code Online (Sandbox Code Playgroud)
ism*_*nni 26
我从这里的讨论中得到了答案:
我试过了
pip install --no-index -f http://dist.plone.org/thirdparty/ -U PIL
Run Code Online (Sandbox Code Playgroud)
它起作用了.
Ane*_*R S 11
对于Ubuntu,PIL不再工作了.我总是得到:
找不到PIL的匹配分布
所以安装python-imaging:
sudo apt-get install python-imaging
Run Code Online (Sandbox Code Playgroud)
Dmi*_*kov 11
这些天,每个人都使用Pillow,一个友好的PIL叉子,而不是PIL.
代替: sudo pip install pil
做: sudo pip install pillow
$ sudo apt-get install python-imaging
$ sudo -H pip install pillow
Run Code Online (Sandbox Code Playgroud)
KGo*_*KGo 10
我认为你在Mac上.请参阅如何在mac os x 10.7.2 Lion上安装PIL
如果你使用[homebrew] [],你可以用刚安装PIL
brew install pil.然后,您可能需要将安装目录($(brew --prefix)/lib/python2.7/site-packages)添加到PYTHONPATH,或者将PIL目录本身的位置添加到PIL.pth任何site-packages目录中名为file的文件中,其内容为:Run Code Online (Sandbox Code Playgroud)/usr/local/lib/python2.7/site-packages/PIL(假设
brew --prefix是/usr/local).或者,您可以从源代码下载/构建/安装它:
Run Code Online (Sandbox Code Playgroud)# download curl -O -L http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz # extract tar -xzf Imaging-1.1.7.tar.gz cd Imaging-1.1.7 # build and install python setup.py build sudo python setup.py install # or install it for just you without requiring admin permissions: # python setup.py install --user我刚刚运行上面的命令(在OSX 10.7.2上,使用XCode 4.2.1和System Python 2.7.1)并且它构建得很好,尽管我的环境中有些东西可能是非默认的.
[homebrew]:http://mxcl.github.com/homebrew/ "Homebrew"
我有同样的问题,但它通过安装得到解决python-dev.
在安装PIL之前,请运行以下命令:
sudo apt-get install python-dev
Run Code Online (Sandbox Code Playgroud)
然后安装PIL:
pip install PIL
Run Code Online (Sandbox Code Playgroud)
安装过程中出现了一些错误.以防有人也这样做.尽管我已经坐在管理员用户下,但不是root用户.
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/PIL'
Storing debug log for failure in /Users/wzbozon/Library/Logs/pip.log
Run Code Online (Sandbox Code Playgroud)
添加"sudo"解决了这个问题,sudo工作正常:
~/Documents/mv-server: $ sudo pip install Pillow
Run Code Online (Sandbox Code Playgroud)
我尝试了所有的答案,但是发了故事.直接从官方网站获取源代码,然后构建安装成功.
Install
pip install Pillow
Run Code Online (Sandbox Code Playgroud)
Then, Just import in your file like,
from PIL import Image
Run Code Online (Sandbox Code Playgroud)
I am using windows. It is working for me.
| 归档时间: |
|
| 查看次数: |
740655 次 |
| 最近记录: |