18

In order to run Pelican, I installed python2.7 and modified first line of file /usr/bin/pelican-quickstart

from:

#!/usr/bin/python

to

#!/usr/bin/env python

when I type pelican-quickstart an error occured:

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:

/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.

hack4m
  • 275
  • 1
  • 5
  • 11

2 Answers2

5

The problem must be an issue with your setup tools, try the following:

pip install --upgrade setuptools
pip install --upgrade distribute

If this solution doesn't work, you can check the following answer

Community
  • 1
  • 1
Leonardo
  • 2,349
  • 2
  • 21
  • 36
  • 57
    Both these commands give me the same error as the original question ("ImportError: No module named pkg_resources) – Jonathan Hartley Apr 04 '14 at 12:31
  • 11
    Why was this answer accepted? – Cerin Jun 22 '14 at 05:15
  • 3
    @Cerin I guess because of the linked answer which works – Karl Richter Jul 10 '14 at 10:50
  • 3
    I ran into this issue when trying to use virtualenvwrapper on python2.7.3. Using this fix worked for me. Thank you Leonardo! – Will Charlton Dec 11 '14 at 15:35
  • I had the same issue as JonathanHartley and then read WillCharlton's comment and followed the link. The Link lead me to my answer. – Jacksonkr Jun 16 '17 at 15:16
  • To fix the issue, run the setup script for setuptools: wget https://bootstrap.pypa.io/ez_setup.py -O - | python (or if you don't have wget installed (e.g. OS X), try curl https://bootstrap.pypa.io/ez_setup.py | python possibly with sudo prepended.) If you have any version of distribute, or any setuptools below 0.6, you will have to uninstall it first.* – NAVEEN Kumar Jul 16 '20 at 17:31
-3

You said

/usr/lib/python2.6/site-package/

but should be

/usr/lib/python2.6/site-packages/
BarryPye
  • 1,495
  • 2
  • 14
  • 16