简体   繁体   中英

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. I Installed a fresh "RASPBIAN STRETCH LITE" then I entered following commands via an ssh connection:

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)

It looks like it is the Pillow installation that is failing. You need to install the python development libraries first

# 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. I'm not sure what the equivalents are for 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!

Instead of running the Django CMS installer, I would try to get Pillow to install by itself. 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.

pip install 'Pillow==3.0'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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