我在 Centos 6 Linux 上
当我尝试这个
Python 2.7.3 (default, Nov 23 2012, 18:02:22)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import readline
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: No module named readline
>>>
我尝试用 pip 安装 python readline,我得到了这个
virtualenv/bin/pip-2.7 install readline
Requirement already satisfied (use --upgrade to upgrade): readline in ./virtualenv/lib/python2.7/site-packages/readline-6.2.4.1-py2.7-linux-x86_64.egg
Cleaning up...
我应该怎么办
编辑:
我也试过这个
[myhost]$ virtualenv/bin/python2.7
Python 2.7.3 (default, Nov 23 2012, 18:02:22)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import readline
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named readline
>>>
我尝试了所有这些
(virtualenv)[aaaaaa]$ source virtualenv/bin/activate
(virtualenv)[aaaaaa]$ virt
virtualenv/ virtualenv-clone virtualenvwrapper.sh
virtualenv-2.7 virtualenvwrapper_lazy.sh virt-what
(virtualenv)[aaaaaa]$ virtualenv/bin/pip
pip pip-2.7
(virtualenv)[aaaaa]$ virtualenv/bin/pip install readline
Requirement already satisfied (use --upgrade to upgrade): readline in ./virtualenv/lib/python2.7/site-packages/readline-6.2.4.1-py2.7-linux-x86_64.egg
Cleaning up...
(virtualenv)[aaaaa]$ python
Python 2.7.3 (default, Nov 23 2012, 18:02:22)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import readline
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named readline
>>>
我尝试了所有虚拟环境并激活了。但我再次得到同样的错误