我遇到了一个 github 项目,我正在尝试安装并运行它,但遇到了一些问题( https://github.com/andrewschoen/django-cms-demo )。我也将其作为一个问题提出 https://github.com/andrewschoen/django-cms-demo/issues/2 .
如果我理解正确的话,问题似乎与安装 PIL 有关:
Running setup.py egg_info for package PIL
WARNING: '' not a valid package name; please use only.-separated package na
es in setup.py
我尝试通过将requirements.txt中的行更改为:Pillow==1.7.8来“插入”Pillow
$ pip install -r requirements.txt
............
copying PIL\XVThumbImagePlugin.py -> build\lib.win32-2.7\PIL
running build_ext
building '_imaging' extension
f:\python27\Lib\distutils\dist.py:267: UserWarning: Unknown distribution option:
'use_2to3'
warnings.warn(msg)
error: Unable to find vcvarsall.bat
----------------------------------------
Command f:\django-cms-demo\env\Scripts\python.exe -c "import setuptools;__file__
='f:\\django-cms-demo\\env\\build\\Pillow\\setup.py';exec(compile(open(__file__)
.read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\dni
r\appdata\local\temp\pip-cjnff6-record\install-record.txt --single-version-exter
nally-managed --install-headers f:\django-cms-demo\env\include\site\python2.7 fa
iled with error code 1 in f:\django-cms-demo\env\build\Pillow
Storing complete log in m:/pip\pip.log
我刚从 php 开始使用 python 和 django 。我正在尝试在 USB 驱动器上设置此项目,并且我正在 win7 上工作。
预先感谢您的想法,
比尔
最佳答案
PIL 未正确打包;有一些 fork 可以解决这个问题。
来自The problem with installing PIL using virtualenv or buildout ,目前最好的选择是安装 Pillow反而;它是 PIL 的直接替代品。
对于 Windows,请使用 precompiled installer from Christoph Gohlke相反。
关于python - 警告 : '' not a valid package name; please use only. -setup.py 中不存在分隔包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15142272/