今天使用easy_install命令的时候碰到如下错误:
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
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:
Check your /usr/bin and /usr/local/bin for easy_install installations and remove any old script:
2. 下载和安装distribute[root@localhost scribe-v2.3.5]#sudo rm /usr/bin/easy_install*
[root@localhost scribe-v2.3.5]#sudo rm /usr/local/bin/easy_install*
Download and run distribute:
再次尝试[root@localhost scribe-v2.3.5]#curl -O http://python-distribute.org/distribute_setup.py
[root@localhost scribe-v2.3.5]#sudo python distribute_setup.py
[root@localhost scribe-v2.3.5]# sudo rm distribute_setup.py
[root@localhost scribe-v2.3.5]#easy_install python-snappy==0.4
成功。