python-3.x - library - pillow python install
¿Cómo instalo PIL/Pillow para Python 3.6? (3)
Almohada se lanza con ruedas de instalación en Windows:
Proporcionamos archivos binarios Pillow para Windows compilados para la matriz de Pythons admitidos en versiones de 32 y 64 bits en los instaladores de rueda, huevo y ejecutables. Estos binarios tienen todas las bibliotecas opcionales incluidas
https://pillow.readthedocs.io/en/3.3.x/installation.html#basic-installation
Actualización: Python 3.6 ahora es compatible con Pillow. Instale con pip install pillow
y consulte https://pillow.readthedocs.io/en/latest/installation.html para obtener más información.
Sin embargo, Python 3.6 aún se encuentra en versión alfa y todavía no se admite oficialmente, aunque todas las pruebas pasan todas las compilaciones nocturnas de Python (actualmente 3.6a4).
https://travis-ci.org/python-pillow/Pillow/jobs/155605577
Si de alguna manera es posible instalar la rueda 3.5 para 3.6, esa es tu mejor apuesta. De lo contrario, a pesar de zlib, tendrá que compilar desde el origen, requiriendo un compilador de MS Visual C ++, y que no sea sencillo. Para consejos ver:
https://pillow.readthedocs.io/en/3.3.x/installation.html#building-from-source
Y también vea cómo está construido para Windows en AppVeyor CI (pero aún no 3.5 o 3.6):
https://github.com/python-pillow/Pillow/tree/master/winbuild
Si esto falla, baja a Python 3.5 o espera hasta que 3.6 sea compatible con Pillow, probablemente más cerca del lanzamiento oficial de 3.6.
Tengo un script que requiere PIL para ejecutarse. Aparte de degradar mi Python, no pude encontrar el modo de instalar PIL en mi Python 3.6
Aquí están mis intentos:
pip install pil
Collecting pil
Could not find a version that satisfies the requirement pil (from versions: )
No matching distribution found for pil
pip install Pillow
Collecting Pillow
Using cached Pillow-3.3.1.zip
Installing collected packages: Pillow
Running setup.py install for Pillow ... error
Complete output from command c:/python/python36/python.exe -u -c "import setuptools, tokenize;__file__=''C://Users//ABDULR~1//AppData//Local//Temp//pip-build-rez5zpri//Pillow//setup.py'';exec(compile(getattr(tokenize, ''open'', open)(__file__).read().replace(''/r/n'', ''/n''), __file__, ''exec''))" install --record C:/Users/ABDULR~1/AppData/Local/Temp/pip-a5bugnjo-record/install-record.txt --single-version-externally-managed --compile:
Single threaded build for windows
running install
running build
running build_py
creating build
creating build/lib.win-amd64-3.6
creating build/lib.win-amd64-3.6/PIL
copying PIL/......................
..................................
..................................
running egg_info
writing Pillow.egg-info/PKG-INFO
writing dependency_links to Pillow.egg-info/dependency_links.txt
writing top-level names to Pillow.egg-info/top_level.txt
warning: manifest_maker: standard file ''-c'' not found
reading manifest file ''Pillow.egg-info/SOURCES.txt''
reading manifest template ''MANIFEST.in''
warning: no files found matching ''*.sh''
no previously-included directories found matching ''docs/_static''
warning: no previously-included files found matching ''.coveragerc''
warning: no previously-included files found matching ''.editorconfig''
warning: no previously-included files found matching ''.landscape.yaml''
warning: no previously-included files found matching ''appveyor.yml''
warning: no previously-included files found matching ''build_children.sh''
warning: no previously-included files found matching ''tox.ini''
warning: no previously-included files matching ''.git*'' found anywhere in distribution
warning: no previously-included files matching ''*.pyc'' found anywhere in distribution
warning: no previously-included files matching ''*.so'' found anywhere in distribution
writing manifest file ''Pillow.egg-info/SOURCES.txt''
copying PIL/OleFileIO-README.md -> build/lib.win-amd64-3.6/PIL
running build_ext
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:/Users/ABDULR~1/AppData/Local/Temp/pip-build-rez5zpri/Pillow/setup.py", line 753, in <module>
zip_safe=not debug_build(), )
File "c:/python/python36/lib/distutils/core.py", line 148, in setup
dist.run_commands()
File "c:/python/python36/lib/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:/python/python36/lib/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "c:/python/python36/lib/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "c:/python/python36/lib/distutils/command/install.py", line 539, in run
self.run_command(''build'')
File "c:/python/python36/lib/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:/python/python36/lib/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "c:/python/python36/lib/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "c:/python/python36/lib/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:/python/python36/lib/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "c:/python/python36/lib/distutils/command/build_ext.py", line 338, in run
self.build_extensions()
File "C:/Users/ABDULR~1/AppData/Local/Temp/pip-build-rez5zpri/Pillow/setup.py", line 521, in build_extensions
'' using --disable-%s, aborting'' % (f, f))
ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting
----------------------------------------
Command "c:/python/python36/python.exe -u -c "import setuptools, tokenize;__file__=''C://Users//ABDULR~1//AppData//Local//Temp//pip-build-rez5zpri//Pillow//setup.py'';exec(compile(getattr(tokenize, ''open'', open)(__file__).read().replace(''/r/n'', ''/n''), __file__, ''exec''))" install --record C:/Users/ABDULR~1/AppData/Local/Temp/pip-a5bugnjo-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:/Users/ABDULR~1/AppData/Local/Temp/pip-build-rez5zpri/Pillow/
No sabía agregar el argumento --disable-zlib
, pip install Pillow --disable-zlib
no era correcto.
No se pudo encontrar lo que coincide con mi sistema aquí: https://pypi.python.org/pypi/Pillow/3.0.0
Windows 10 y Python 3.6 de 64 bits
Para la versión 2.x de Python, simplemente puede usar
-
pip install pillow
Pero para Python versión 3.X debes especificar
-
(sudo) pip3 install pillow
Cuando ingrese PIP en la pestaña de golpe de bash y verá qué opciones tiene
Puede descargar la rueda correspondiente a su configuración here ("Almohada ‑ 4.1.1-cp36 ‑ cp36m ‑ win_amd64.whl" en su caso) e instalarla con :
pip install some-package.whl
Si tienes problemas para instalar la rueda lee esta respuesta.