创建新的django-cms项目时出错

时间:2014-06-12 13:01:54

标签: pip django-cms

我想安装django-cms,但是当我想用这段代码创建一个新项目时

>>djangocms -p . my_demo

我收到此错误:

(myLibrary)Mehradads-MacBook-Pro-3:Workspace mehradad$ 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 stable]: 1.5.8
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
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
Use custom template set [default no]: 
Load a starting page with examples after installation. Choose "no" if you use a custom template set. (choices: yes, no) [default no]: yes
INFO: Starting new HTTPS connection (1): pypi.python.org

Command /Users/mehradad/Web_project/Workspace/myLibrary/bin/python -c "import setuptools, tokenize;__file__='/Users/mehradad/Web_project/Workspace/myLibrary/build/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/v5/gzrs3m_932x8gfpqc5lt6kh00000gn/T/pip-3JZJJw-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mehradad/Web_project/Workspace/myLibrary/include/site/python2.7 failed with error code 1 in /Users/mehradad/Web_project/Workspace/myLibrary/build/Pillow
Storing debug log for failure in /Users/mehradad/.pip/pip.log
Traceback (most recent call last):
  File "/Users/mehradad/Web_project/Workspace/myLibrary/bin/djangocms", line 11, in <module>
    sys.exit(execute())
  File "/Users/mehradad/Web_project/Workspace/myLibrary/lib/python2.7/site-packages/djangocms_installer/main.py", line 25, in execute
    install.requirements(config_data.requirements)
  File "/Users/mehradad/Web_project/Workspace/myLibrary/lib/python2.7/site-packages/djangocms_installer/install/__init__.py", line 64, in requirements
    raise InstallationError("Error while installing requirements. Check pip log file for error details.")
pip.exceptions.InstallationError: Error while installing requirements. Check pip log file for error details.

我不知道为什么会收到此错误! 我在max osx 10.8.5中创建了这个项目

任何人都可以帮我解决这个问题!? 感谢

3 个答案:

答案 0 :(得分:3)

我在Ubuntu上运行,所以我的设置有点不同。但基本上我查看了pip.log文件(cat~ / .pip / pip.log),发现我的机器缺少必要的编译文件,所以我不得不这样做:

sudo apt-get update
sudo apt-get install g++
sudo apt-get install python-dev

(基于我发现的on another stackoverflow question):

sudo apt-get install libjpeg-dev libfreetype6-dev zlib1g-dev
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/
pip uninstall pillow
pip install pillow

由于您使用的是MacOS,因此您的情况会有所不同,但希望这会指向正确的方向。

答案 1 :(得分:2)

最后我找到了正确的解决方案:

首先安装:

$ brew install libtiff libjpeg webp little-cms2

然后设置环境的先前值:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

然后通过pip安装枕头:

$ pip install pillow

现在安装djnago项目:

$ djangocms -p . mysite

答案 2 :(得分:1)

除了Mehrdad Taraji的评论。

如果您使用的是Mavericks(Mac OS)

只需安装:

xcode-select --install