Raspberry Pi 3上的Django CMS失败

时间:2018-03-07 20:54:08

标签: python django python-2.7 raspberry-pi django-cms

今天我尝试在我的Raspberry pi上安装django CMS一段时间但是它不起作用。我安装了一个新的" RASPBIAN STRETCH LITE"然后我通过ssh连接输入以下命令:

sudo wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo pip install Django==1.10
sudo pip install virtualenv
cd /srv
sudo mkdir django_cms
cd django_cms
sudo virtualenv env
source env/bin/activate
sudo pip install --upgrade pip
sudo pip install djangocms-installer
sudo mkdir django_site
cd django_site/
sudo djangocms -f -p . web_site

所有这一切都遵循guide 执行上面的最后一个命令后会抛出此错误:

    Creating the project
Please wait while I install dependencies
ERROR: cmd : [u'pip', u'install', u'-q', u'django-cms>=3.5,<3.6', u'djangocms-admin-style>=1.2,<1.3', u'django-treebeard>=4.0,<5.0', u'https://github.com/divio/djangocms-text-ckeditor/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-file/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-link/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-style/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-googlemap/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-snippet/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-picture/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-video/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-column/archive/master.zip?1520455195.14', u'easy_thumbnails', u'django-filer>=1.3', u'Django<2.0', u'pytz', u'django-classy-tags>=0.7', u'html5lib>=0.999999,<0.99999999', u'Pillow>=3.0', u'django-sekizai>=0.9', u'six'] :Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FFzxtb/Pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-CPB18v-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-FFzxtb/Pillow/

The installation has failed.


*****************************************************************

Check documentation at https://djangocms-installer.readthedocs.io

*****************************************************************

Traceback (most recent call last):
  File "/usr/local/bin/djangocms", line 11, in <module>
    sys.exit(execute())
  File "/usr/local/lib/python2.7/dist-packages/djangocms_installer/main.py", line 33, in execute
    verbose=config_data.verbose
  File "/usr/local/lib/python2.7/dist-packages/djangocms_installer/install/__init__.py", line 95, in requirements
    output = subprocess.check_output(['pip'] + args, stderr=subprocess.STDOUT)
  File "/usr/lib/python2.7/subprocess.py", line 219, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '[u'pip', u'install', u'-q', u'django-cms>=3.5,<3.6', u'djangocms-admin-style>=1.2,<1.3', u'django-treebeard>=4.0,<5.0', u'https://github.com/divio/djangocms-text-ckeditor/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-file/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-link/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-style/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-googlemap/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-snippet/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-picture/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-video/archive/master.zip?1520455195.14', u'https://github.com/divio/djangocms-column/archive/master.zip?1520455195.14', u'easy_thumbnails', u'django-filer>=1.3', u'Django<2.0', u'pytz', u'django-classy-tags>=0.7', u'html5lib>=0.999999,<0.99999999', u'Pillow>=3.0', u'django-sekizai>=0.9', u'six']' returned non-zero exit status 1

你们中有谁有解决方案吗?

(我的Python版本:2.7.13)

1 个答案:

答案 0 :(得分:0)

看起来Pillow安装失败了。您需要先安装python开发库

# Python 2
sudo apt-get install python-dev python-setuptools

# Python 3
sudo apt-get install python3-dev python3-setuptools

您还必须安装其他一些先决条件。 Pillow文档为Ubuntu 14.04提供了以下先决条件。我不确定Raspian Stretch的等价物是什么

sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev \
tcl8.6-dev tk8.6-dev python-tk

有关详细信息,请参阅Pillow docs

由于您正在开始一个新项目,请允许我鼓励您使用Python 3!

我会尝试让Pillow自行安装,而不是运行Django CMS安装程序。如果失败,则错误消息应该更明显。

pip install Pillow

如果最新版本失败,您可以尝试3.0,因为这似乎是Django CMS的最低版本。

pip install 'Pillow==3.0'