windows - 如何在 Windows 上安装 Pillow 依赖项(没有二进制文件)?

标签 windows zlib django-cms pillow libjpeg

我正在尝试在 Windows 10 上使用 Python3 在 vi​​rtualenv 中运行 django-cms。

如果我按照他们网站上的安装步骤并运行命令 djangocms mysite 然后我得到这个错误:

Creating the project
Please wait while I install dependencies
Dependencies installed
Creating the project

*****************************************************************

Check documentation at https://djangocms-installer.readthedocs.io

*****************************************************************

Traceback (most recent call last):
File "c:\users\guter\appdata\local\programs\python\python36-32\lib\runpy.py", 
line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\guter\appdata\local\programs\python\python36-32\lib\runpy.py", 
line 85, in _run_code
exec(code, run_globals)
File "C:\Users\guter\AppData\Local\Programs\Python\Python36-
32\Scripts\djangocms.exe\__main__.py", line 9, in <module>
File "c:\users\guter\appdata\local\programs\python\python36-32\lib\site-
packages\djangocms_installer\main.py", line 36, in
execute
install.check_install(config_data)
File "c:\users\guter\appdata\local\programs\python\python36-32\lib\site-
packages\djangocms_installer\install\__init__.py",
line 79, in check_install
raise EnvironmentError('\n'.join(errors))

OSError: Pillow is not installed check for installation errors and see 
"Libraries installation issues" documentation section:
https://djangocms-installer.readthedocs.io/en/latest/libraries.html

安装 PIL 时似乎缺少 libjpeg(用于 Pillow 中的 JPEG 支持)和 zlib(用于 Pillow 中的 PNG 支持),但是是否有“简单”的方式在 Windows 上获取它们?禁用不是解决方案,因为它们是 django-cms 需要的...

也许 this解决方案会起作用,但对于 virtualenv,它不是一个很好的解决方法......

但是问题应该是可以解决的吧? ;-)

最佳答案

您正在链接到旧版本的文档。最新版本https://pillow.readthedocs.io/en/4.1.1/installation.html说:

In general, we aim to support all current versions of Linux, macOS, and Windows.

但是:

We don’t recommend trying to build on Windows. It is a maze of twisty passages, mostly dead ends. There are build scripts and notes for the Windows build in the w i n b u i l d directory.

但是:

We provide Pillow binaries for Windows compiled for the matrix of supported Pythons in both 32 and 64-bit versions in wheel, egg, and executable installers. These binaries have all of the optional libraries included

所以我建议你按照通常的方式使用pip安装。

关于windows - 如何在 Windows 上安装 Pillow 依赖项(没有二进制文件)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43675791/

相关文章:

Django CMS 和 Rosetta : Can't get template messages translated

python - DjangoCMS 创建项目失败

c++ - SDL 和 zlib 问题,无法从 zip 创建有效的 rwops 结构

c++ - ZLib.lib(d000062.o) : warning LNK4078: multiple '.text' sections found with different attributes

python - 在 Python 中运行一些超时代码的正确方法

windows - 从 Windows Phone 应用程序使用 EventBrite oAuth

c - 使用 zlib 解压 PNG

django-cms - 使用没有命名空间的 Apphook 时 NoReverseMatch

使用 html 的 Android 应用程序

python - 逐字书写文本