Python:导入错误:没有名为 pkg_resources 的模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22148144/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Python: ImportError: No module named pkg_resources
提问by hack4m
In order to run Pelican, I installed python2.7 and modified first line of file /usr/bin/pelican-quickstart
为了运行 Pelican,我安装了 python2.7 并修改了文件 /usr/bin/pelican-quickstart 的第一行
from:
从:
#!/usr/bin/python
to
到
#!/usr/bin/env python
when I type pelican-quickstart an error occured:
当我输入 pelican-quickstart 时出现错误:
Traceback (most recent call last):
File "/usr/bin/pelican-quickstart", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
I found "pkg_resources" is in this directory:
我发现“pkg_resources”在这个目录中:
/usr/lib/python2.6/site-package/
I'm wondering if I have to install some packages after python2.7 is installed? or, how can I solve this problem.
我想知道安装python2.7后是否需要安装一些包?或者,我该如何解决这个问题。
回答by Leonardo
回答by BarryPye
You said
你说
/usr/lib/python2.6/site-package/
but should be
但应该是
/usr/lib/python2.6/site-packages/

