码迷,mamicode.com
首页 > 其他好文 > 详细

Pthon No module named pkg_resources

时间:2017-10-30 15:56:25      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:org   environ   counter   hat   you   first   erer   ken   been   

好记性不如烂笔头。

I encountered the same ImportError today while trying to use pip. Somehow the setuptools package had been deleted in my Python environment.

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

See Installation Instructions for further details.


* If you already have a working distribute, upgrading it to the "compatibility wrapper" that switches you over to setuptools is easier. But if things are already broken, don‘t try that.

 

Try these:

# Get rid of them
$ python -m pip uninstall -y setuptools
$ python -m pip uninstall -y distribute
# the next command should FAIL now because the above should be uninstalled
$ python -c "import pkg_resources"
# reinstall stuff now
$ python -m pip install -U --force-reinstall setuptools
$ python -m pip install -U --force-reinstall pip
# now check things work and are the same
$ python -m pip --version
$ pip --version
$ pip list



referer:
http://bird.so/search?q=No%20module%20named%20pkg_resources
https://github.com/pypa/pip/issues/1800

Pthon No module named pkg_resources

标签:org   environ   counter   hat   you   first   erer   ken   been   

原文地址:http://www.cnblogs.com/sevck/p/7754597.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!