Python easy_install 遇到“ImportError: No module named pkg_resources”错误
今天使用easy_install命令的时候碰到如下错误:# easy_install python-snappy==0.4
Traceback (most recent call last):
File "/usr/bin/easy_install", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
估计是版本不兼容的问题。
1. 删除easy_install命令相关的可执行文件
Check your /usr/bin and /usr/local/bin for easy_install installations and remove any old script:
#sudo rm /usr/bin/easy_install*
#sudo rm /usr/local/bin/easy_install*
2. 下载和安装distribute
Download and run distribute:
#curl -O http://python-distribute.org/distribute_setup.py
#sudo python distribute_setup.py
# sudo rm distribute_setup.py
再次尝试
#easy_install python-snappy==0.4
成功。
页:
[1]