python - Django-cms 无法按照教程创建项目创建项目发生失败

标签 python django centos django-cms centos7

使用 CentOS 7 并尝试按照教程进行操作,但失败了。

我使用了 virtualenvwrapper。

mkvirtualenv env

然后我按照教程进行操作。

创建项目之前。

(env)[***@*** ~]$ python -V
Python 3.4.3
(env)[***@*** ~]$ pip list
pip {7.1.2)
setuptools (18.2)
wheel (0.24.0)

安装 djangocms-installer:

(env)[***@*** ~]$ pip install djangocms-installer
Collecting djangocms-installer
  Using cached djangocms_installer-0.8.0-py2.py3-none-any.whl
Collecting six (from djangocms-installer)
  Using cached six-1.9.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pip in ./.virtualenvs/env/lib/python3.4/site-packages (from djangocms-installer)
Collecting tzlocal (from djangocms-installer)
Collecting argparse (from djangocms-installer)
  Using cached argparse-1.4.0-py2.py3-none-any.whl
Collecting dj-database-url (from djangocms-installer)
  Using cached dj_database_url-0.3.0-py2.py3-none-any.whl
Collecting pytz (from tzlocal->djangocms-installer)
  Using cached pytz-2015.6-py2.py3-none-any.whl
Installing collected packages: six, pytz, tzlocal, argparse, dj-database-url, djangocms-installer
Successfully installed argparse-1.4.0 dj-database-url-0.3.0 djangocms-installer-0.8.0 pytz-2015.6 six-1.9.0 tzlocal-1.2

创建项目:

(env)[***@*** ~]$ mkdir tutorial-project
(env)[***@*** ~]$ cd tutorial-project/
(env)[***@*** tutorial-project]$ djangocms -p . mysite
Database configuration (in URL format) [default sqlite://localhost/project.db]:
django CMS version (choices: 2.4, 3.0, 3.1, stable, develop) [default stable]:
Django version (choices: 1.4, 1.5, 1.6, 1.7, 1.8, stable) [default stable]:
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. Only language codes supported by Django can be used here: en, de
Optional default time zone [default America/New_York]: 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
Use custom template set [default no]:
Load a starting page with examples after installation (english language only). Choose "no" if you use a custom template set. (choices: yes, no) [default no]: yes
Creating the project
Please wait while I install dependencies
Dependencies installed
Creating the projectFailure occurred. Do you want to cleanup by removing /home/***/tutorial-project? [Y/N] N

无论我输入 Y 或 N,目录都是空的,但输入 N 后会出现以下内容。

Traceback (most recent call last):
  File "/home/***/.virtualenvs/env/lib/python3.4/site-packages/djangocms_installer/main.py", line 31, in execute
    install.check_install(config_data)
  File "/home/***/.virtualenvs/env/lib/python3.4/site-packages/djangocms_installer/install/__init__.py", line 55, in check_install
    raise EnvironmentError("\n".join(errors))
OSError: Pillow is not compiled with JPEG support, see 'Libraries installation issues' documentation section: http://djangocms-installer.readthedocs.org/en/latest/libraries.html

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/***/.virtualenvs/env/bin/djangocms", line 11, in <module>
    sys.exit(execute())
  File "/home/***/.virtualenvs/env/lib/python3.4/site-packages/djangocms_installer/main.py", line 57, in execute
    "http://djangocms-installer.rtfd.org\n" % e).with_traceback(tb)
  File "/home/***/.virtualenvs/env/lib/python3.4/site-packages/djangocms_installer/main.py", line 31, in execute
    install.check_install(config_data)
  File "/home/***/.virtualenvs/env/lib/python3.4/site-packages/djangocms_installer/install/__init__.py", line 55, in check_install
    raise EnvironmentError("\n".join(errors))
OSError: Pillow is not compiled with JPEG support, see 'Libraries installation issues' documentation section: http://djangocms-installer.readthedocs.org/en/latest/libraries.html
Documentation available at http://djangocms-installer.rtfd.org

创建项目失败后的pip列表:

dj-database-url (0.3.0)
Django (1.7.10)
django-classy-tags (0.6.2)
django-cms (3.1.3)
django-reversion (1.8.5)
django-sekizai (0.8.2)
Django-Select2 (4.3.1)
django-treebeard (3.0)
djangocms-admin-style (0.2.8)
djangocms-column (1.5)
djangocms-file (0.1)
djangocms-flash (0.2.0)
djangocms-googlemap (0.3)
djangocms-inherit (0.1)
djangocms-installer (0.8.0)
djangocms-link (1.7.0.dev1)
djangocms-picture (0.1)
djangocms-style (1.5)
djangocms-teaser (0.1)
djangocms-text-ckeditor (2.6.0)
djangocms-video (0.1)
html5lib (0.9999999)
Pillow (2.9.0)
pip (7.1.2)
pytz (2015.6)
setuptools (18.2)
six (1.9.0)
tzlocal (1.2)
wheel (0.24.0)

我试过了

sudo yum install libjpeg-devel libpng-devel libtiff-devel freetype-devel zlib-devel

谢谢。

最佳答案

This answer ,特别是 CentOS 评论,可能对您有用。

sudo yum install libjpeg-turbo-devel libpng-devel zlib-devel

此外,根据评论,您可能需要卸载并重新安装 Pillow。 看这个related post on Pillow errors for DjangoCMS .

关于python - Django-cms 无法按照教程创建项目创建项目发生失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32708681/

相关文章:

python - 处理 Python 内存使用的可能修复

django - Docker和Django manage.py

apache - vagrant 中的 JS 和 CSS 文件在 VM 外部保存时未正确编码

centos - 如何在 OS X 和 Linux 上使用 unison?由于 ocaml 版本导致的 fatal error

node.js - Winston - 使用 maxsize 时记录轮换顺序

python - Pygame 音频断断续续和滞后

python - 一行python中的if-else语句

python - R Keras 中的自定义损失函数

python - 为什么要对 django 1.7+ 使用 __unicode__(self) 方法?

python - 如何在 django 中向所有用户公开主题?