当我尝试以下命令时
pip install requests
我收到以下错误
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 343, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2307, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2013, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/__init__.py", line 10, in <module>
from pip.util import get_installed_distributions, get_prog
File "/usr/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/util.py", line 8, in <module>
import zipfile
File "/usr/lib/python2.7/zipfile.py", line 6, in <module>
import io
File "/usr/lib/python2.7/io.py", line 60, in <module>
import _io
ImportError: No module named _io
但是当我尝试env
使用以下命令检查时
env python
我可以看到它仅从 python 2.7 运行
Python 2.7.3 (default, Dec 18 2012, 13:50:09)
[GCC 4.5.3] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
所以在交互式命令行中我尝试了以下
>>> import _io
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named _io