我正在关注此文档以安装Pelican http://docs.getpelican.com/en/3.7.1/quickstart.html
在此步骤中,抛出了导入错误。
cd ~/projects/yoursite/output
python -m pelican.server
导入错误:
MacBook-Air:output dorjee$ python3 -m pelican.server
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3: Error
while finding spec for 'pelican.server' (<class 'ImportError'>: No
module named 'pelican')
答案 0 :(得分:1)
在检查pelican版本时,我意识到python虚拟环境未被激活。当它被激活时,错误就消失了。
$ pelican --version
-bash: pelican: command not found `
$ source ~/Environments/pelicanenv/bin/activate
$ python3 -m pelican.server
127.0.0.1 - - [20/Sep/2017 23:08:49] "GET / HTTP/1.1" 200 - `