加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

运行django-cms演示页时出错

发布时间:2020-12-20 13:04:54 所属栏目:Python 来源:网络整理
导读:我尝试了所有安装 django-cms的程序,之后当我尝试运行一个演示页面时,我收到以下错误. (djvenv2)shan@shan:~/workspace/projects/djvenv$pip freezeDjango==1.6.2PIL==1.1.7Pillow==2.4.0South==0.8.4argparse==1.2.1dj-database-url==0.3.0django-classy-ta
我尝试了所有安装 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.

解决方法

向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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读