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

时间:2022-11-23 06:51:40

I'm trying to run django-cms on Windows 10 with Python3 in a virtualenv.

我试着在Windows 10上运行django-cms,在virtualenv中使用Python3。

If I'm following the installation steps on their website and running the command djangocms mysite then I get this error:

如果我按照他们网站上的安装步骤运行命令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

It seems like libjpeg (for JPEG support in Pillow) and zlib (for PNG support in Pillow) is missing for the Installation of PIL, but is there an "easy" way on windows to get them? Disableing is not the solution, because they are for django-cms required...

似乎libjpeg(用于枕头中的JPEG支持)和zlib(用于枕头中的PNG支持)在PIL的安装中都没有,但是windows上有“容易”的方法来获取它们吗?去功能化不是解决办法,因为这是django-cms需要的。

Maybe this solution will work, but for an virtualenv, its not a pretty workaround...

也许这个解决方案会奏效,但是对于一个虚拟人来说,这不是一个很好的解决方案。

But the problem should be solveable? ;-)

但问题应该是可以解决的吗?:-)

3 个解决方案

#1


2  

You're linking to an old version of the docs. The latest version https://pillow.readthedocs.io/en/4.1.1/installation.html says:

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

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

一般来说,我们的目标是支持所有当前版本的Linux、macOS和Windows。

But:

但是:

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.

我们不建议尝试在Windows上构建。这是一个曲折的迷宫,大多是死胡同。在wi nbu ld目录中有用于Windows构建的构建脚本和注释。

However:

然而:

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

我们在wheel、egg和可执行安装程序的32和64位版本中为受支持的python矩阵编译的Windows提供枕头二进制文件。这些二进制文件包含所有可选库

So I suggest you install with pip in the usual way.

所以我建议你用pip来安装。

#2


0  

I had the same problem. You should try to install Pillow through easy_install:

我也有同样的问题。您应该尝试通过easy_install安装枕头:

easy_install Pillow

#3


0  

I tried this and it solved the problem, pillow worked fine, i don't know what happens for you as I'm using this for Django server purposes.

我尝试了这个,它解决了这个问题,pillow很好,我不知道当我将它用于Django服务器时,会发生什么。

easy_install Pillow

This worked on Windows 10 64-bit

这在64位的Windows 10上是有效的

#1


2  

You're linking to an old version of the docs. The latest version https://pillow.readthedocs.io/en/4.1.1/installation.html says:

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

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

一般来说,我们的目标是支持所有当前版本的Linux、macOS和Windows。

But:

但是:

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.

我们不建议尝试在Windows上构建。这是一个曲折的迷宫,大多是死胡同。在wi nbu ld目录中有用于Windows构建的构建脚本和注释。

However:

然而:

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

我们在wheel、egg和可执行安装程序的32和64位版本中为受支持的python矩阵编译的Windows提供枕头二进制文件。这些二进制文件包含所有可选库

So I suggest you install with pip in the usual way.

所以我建议你用pip来安装。

#2


0  

I had the same problem. You should try to install Pillow through easy_install:

我也有同样的问题。您应该尝试通过easy_install安装枕头:

easy_install Pillow

#3


0  

I tried this and it solved the problem, pillow worked fine, i don't know what happens for you as I'm using this for Django server purposes.

我尝试了这个,它解决了这个问题,pillow很好,我不知道当我将它用于Django服务器时,会发生什么。

easy_install Pillow

This worked on Windows 10 64-bit

这在64位的Windows 10上是有效的