简体   繁体   English

Raspberry Pi 3上的Django CMS失败

[英]Django CMS on Raspberry Pi 3 Fails

Today I tried to install django CMS for a while on my Raspberry pi but it will not work. 今天,我尝试在我的Raspberry pi上安装django CMS一段时间,但无法正常工作。 I Installed a fresh "RASPBIAN STRETCH LITE" then I entered following commands via an ssh connection: 我安装了新的“ 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

All this follows this guide 所有这些都遵循本指南
And this error get thrown after executing the last command above: 执行上面的最后一条命令后,将抛出此错误:

    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

Does anyone of you have an solution for this? 你们中有人对此有解决方案吗?

(My Python version: 2.7.13) (我的Python版本:2.7.13)

It looks like it is the Pillow installation that is failing. 看来是Pillow安装失败。 You need to install the python development libraries first 您需要先安装python开发库

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

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

There are some other prerequisites you'll have to install as well. 您还必须安装其他一些先决条件。 The Pillow docs give the following prerequisites for Ubuntu 14.04. Pillow文档为Ubuntu 14.04提供了以下先决条件。 I'm not sure what the equivalents are for Raspian Stretch 我不确定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

See the Pillow docs for more information. 有关更多信息,请参见“ 枕头”文档

Since you're starting a new project, allow me to encourage you to use Python 3! 由于您正在开始一个新项目,请允许我鼓励您使用Python 3!

Instead of running the Django CMS installer, I would try to get Pillow to install by itself. 而不是运行Django CMS安装程序,我将尝试让Pillow自行安装。 If it fails, then the error message should be more obvious. 如果失败,则错误消息应该更明显。

pip install Pillow

If the latest version fails, you could try 3.0, since that seems to be the minimum version for Django CMS. 如果最新版本失败,则可以尝试使用3.0,因为这似乎是Django CMS的最低版本。

pip install 'Pillow==3.0'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM