运行django-cms演示页时出错

Sha*_*nmu 3 django pip django-cms ubuntu-12.04 pillow

我尝试了所有的程序安装的Django-CMS,之后,当我尝试运行演示页我提示以下错误.

(djvenv2)shan@shan:~/workspace/projects/djvenv$ pip freeze
Django==1.6.2
PIL==1.1.7
Pillow==2.4.0
South==0.8.4
argparse==1.2.1
dj-database-url==0.3.0
django-classy-tags==0.5.1
django-cms==3.0
django-mptt==0.6.0
django-sekizai==0.7
djangocms-admin-style==0.2.2
djangocms-installer==0.4.1
html5lib==0.999
six==1.6.1
wsgiref==0.1.2

(djvenv2)shan@shan:~/workspace/projects/djvenv$ djangocms -p . my_demo
Database configuration (in URL format) [default sqlite://localhost/project.db]:
django CMS version (choices: 2.4, 3.0, stable, develop) [default stable]:
Django version (choices: 1.4, 1.5, 1.6, stable) [default 1.5]:
Activate Django I18N / L10N setting (choices: yes, no) [default yes]:
Install and configure reversion support (choices: yes, no) [default yes]:
Languages to enable. Option can be provided multiple times, or as a comma separated list: en
Optional default time zone [default America/Chicago]:
Activate Django timezone support (choices: yes, no) [default yes]:
Activate CMS permission management (choices: yes, no) [default yes]:
Use Twitter Bootstrap Theme (choices: yes, no) [default no]: yes
Load a starting page with examples after installation (choices: yes, no) [default no]: yes
INFO: Starting new HTTPS connection (1): pypi.python.org
Traceback (most recent call last):
  File "/home/shan/workspace/venv/djvenv2/bin/djangocms", line 9, in <module>
    load_entry_point('djangocms-installer==0.4.1', 'console_scripts', 'djangocms')()
  File "/home/shan/workspace/venv/djvenv2/local/lib/python2.7/site-packages/djangocms_installer/main.py", line 24, in execute
    install.check_install(config_data)
  File "/home/shan/workspace/venv/djvenv2/local/lib/python2.7/site-packages/djangocms_installer/install/__init__.py", line 52, in check_install
    raise EnvironmentError("\n".join(errors))
EnvironmentError: Pillow is not compiled with JPEG support, see 'Libraries installation issues' documentation section.
Run Code Online (Sandbox Code Playgroud)

pet*_*tas 20

向Pillow添加JPEG支持,在Ubuntu中,您可以执行以下操作:

sudo apt-get install libjpeg-dev libfreetype6-dev zlib1g-dev

# Link the libraries for Pillow to find them:

sudo ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/

# reinstall Pillow (In case you have Pillow already installed)
pip install --upgrade --force-reinstall pillow
Run Code Online (Sandbox Code Playgroud)

  • 继之后它仍然抛出关于pil和jpeg事情的相同错误...所以我pip卸载枕头再次pip安装枕头...这解决了问题 (2认同)
  • 对于centos用户只需安装`libjpeg-turbo-devel libpng-devel zlib-devel` (2认同)