Estoy tratando de instalar PIL (la Biblioteca de imágenes de Python) usando el comando:
sudo pip install pil
pero recibo el siguiente mensaje:
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…
¿Podrías ayudarme a instalar PIL?
python
python-2.7
installation
pip
python-imaging-library
usuario3006710
fuente
fuente

Respuestas:
https://pypi.python.org/pypi/Pillow/2.2.1
Si tiene ambos Pythons instalados y desea instalar esto para Python3:
fuente
clangerror en OSX Mavericks cuando probé esto, pero descubrí que esta respuesta me ayudó: stackoverflow.com/a/22322645/16959import Image. ¿Hay alguna manera de hacer que Pillow proporcione imagen?Esto funciona para mi:
fuente
# ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/sudo ln -s /usr/include/freetype2 /usr/local/include/freetypeEs muy simple usar apt install, use este comando para hacerlo
o
o
fuente
En Mac OS X, use este comando:
fuente
brew install libjpegDebe instalar como se describe aquí :
fuente
Recibí la respuesta de una discusión aquí :
Lo intenté
Y funcionó.
fuente
pip install --no-index -f http://effbot.org/downloads/ -U PIL --trusted-host effbot.orgLa razón por la que usé este es porque es la URL que figura en el paquete y en pypi.python.org/pypi/PILInstalar en pc
Luego, solo importe en su archivo como,
Estoy usando windows Me esta funcionando.
es decir, cambiar:
import Imagea:
from PIL import Imagehttps://pypi.org/project/Pillow/2.2.1/
fuente
from PIL import Imagenunca pude adivinar que el nombre de esta biblioteca era 'Pillow'. También estoy en Windows y su solución funcionó para mí.import Imageafrom PIL import Imagepypi.org/project/Pillow/2.2.1Supongo que estás en Mac. Consulte ¿Cómo puedo instalar PIL en Mac OS x 10.7.2 Lion?
fuente
pil, no lo hacepipcomo OP intentó inicialmente. Encuentro el uso abundante debrewla web en estos días subóptimo.brewinstalará bastante sobrecarga dependiendo de lo que quieras que haga. por lo quepip, probablemente seguiría siendo la mejor opción para los módulos de Python.En estos días, todos usan Pillow, un tenedor PIL amigable, sobre PIL.
En vez de:
sudo pip install pilHacer:
sudo pip install pillowfuente
sudo pip install .... Eso podría terminar interrumpiendo la instalación de Python en su sistema, lo que puede afectar las aplicaciones de su sistema. Intente usar entornos virtuales Anaconda , venv o Docker.Para Ubuntu, PIL ya no funciona. Siempre obtengo:
Instale python-imaging:
fuente
Tengo el mismo problema, pero se resuelve con la instalación de
python-dev.Antes de instalar PIL, ejecute el siguiente comando:
Luego instale PIL:
fuente
pip install pilResultadosNo distributions at all found for PIL, ya sea que instale python-dev primero o no.Tuve algunos errores durante la instalación. Por si alguien también tiene esto. A pesar de eso, ya estaba sentado bajo usuario administrador, pero no root.
Agregar "sudo" resolvió el problema, con sudo funcionó:
fuente
Para CentOS:
fuente
Intenté todas las respuestas, pero fallé. Obtenga directamente la fuente del sitio oficial y luego construya el éxito de la instalación.
tar xf Imaging-1.1.7.tar.gzcd Imaging-1.1.7sudo python setup.py installfuente
Lo clavé usando
sudo port install py27-Pillowfuente
Prueba esto:
fuente
sudo pip install --allow-external --allow-unverified PIL PILTambién puede funcionar por ahora.--allow-externaly--allow-unverifiedambos están en desuso.pip install pillowEs la respuesta correcta.(Ventana) Si Pilow no funciona, intente descargar pil en http://www.pythonware.com/products/pil/
fuente
Primero debe ejecutar esto,
sudo apt-get build-dep python-imagingque le dará todas las dependencias que pueda necesitar.Entonces corre
sudo apt-get update && sudo apt-get -y upgradeSeguido por
sudo apt-get install python-pipY luego finalmente instalar Pil
pip install pillowfuente
Busque en el administrador de paquetes antes de usar
pip. En Arch Linux puedes obtener PIL porpacman -S python2-pillowfuente
Hay otra herramienta de paquete de Python llamada
conda. Conda es preferible (creo) sobre pip cuando hay bibliotecas que necesitan instalar C ++ y otros enlaces que no son Python puro. Conda también incluye pip en su instalación, por lo que aún puede usar pip, pero también obtiene los beneficios de conda.Conda también instala IPython , pil y muchas otras bibliotecas de forma predeterminada. Creo que te gustará.
fuente