我按照Pelican网站上的程序通过:
source bin/activate
pip install pelican
当我输入pelican-quickstart
时,出现以下错误:
Traceback (most recent call last):
File "/home/ashutosh_mishra/virtualenvs/pelican/bin/pelican-quickstart", line 7, in <module>
from pelican.tools.pelican_quickstart import main
File "/home/ashutosh_mishra/virtualenvs/pelican/lib/python3.2/site-packages/pelican/__init__.py", line 19, in <module>
from pelican.generators import (ArticlesGenerator, PagesGenerator,
File "/home/ashutosh_mishra/virtualenvs/pelican/lib/python3.2/site-packages/pelican/generators.py", line 14, in <module>
from jinja2 import (BaseLoader, ChoiceLoader, Environment, FileSystemLoader,
File "/home/ashutosh_mishra/virtualenvs/pelican/lib/python3.2/site-packages/jinja2/__init__.py", line 33, in <module>
from jinja2.environment import Environment, Template
File "/home/ashutosh_mishra/virtualenvs/pelican/lib/python3.2/site-packages/jinja2/environment.py", line 677
u'\xff\xff\xff\xff'.encode('iso-8859-15')
^
SyntaxError: invalid syntax
我搜索了错误并找到Pelican 3.3 pelican-quickstart error "ValueError: unknown locale: UTF-8"&#39;,但这并没有解决我的问题。
有人可以建议解决方案吗?
答案 0 :(得分:1)
虽然错误追溯指向Jinja2而不是Pelican的问题,但最可能的原因是Python 3.2 - 该版本的Python相当陈旧,并且不再受Jinja2或Pelican开发团队的支持。
升级操作系统可能允许程序包管理器安装更新的Python版本(推荐3.4+)。或者,您可以使用PyEnv之类的工具来安装最新版本的Python,而无需升级您的操作系统。