安装时收到成功消息,但仍然无法导入包!
(testme)ubuntu@msg:~$ sudo pip install redis==2.10.3
Downloading/unpacking redis==2.10.3
Downloading redis-2.10.3.tar.gz (86Kb): 86Kb downloaded
Running setup.py egg_info for package redis
warning: no previously-included files found matching '__pycache__'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
Installing collected packages: redis
Found existing installation: redis 2.9.1
Uninstalling redis:
Successfully uninstalled redis
Running setup.py install for redis
warning: no previously-included files found matching '__pycache__'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
Successfully installed redis
Cleaning up...
1
(testme)ubuntu@msg:~$ pip freeze | grep redis
(testme)ubuntu@msg:~$
2
(testme)ubuntu@msg:~$ python
Python 2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named redis
>>>
我也试过卸载然后安装但没找到运气
答案 0 :(得分:0)
我找到了答案。我正在做sudo pip install redis==2.10.3
,而在virtualenv之外已有相同的软件包安装。所以从virtualenv外面移除了包,它起作用了。