gpt4 book ai didi

python - 无法在 ubuntu 上升级 redis-py 包

转载 作者:可可西里 更新时间:2023-11-01 11:38:57 24 4
gpt4 key购买 nike

安装成功但仍然无法导入包!

 (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
>>>

我也试过先卸载再安装,但没有成功

最佳答案

我找到了答案。我正在做 sudo pip install redis==2.10.3 而在 virtualenv 之外已经安装了相同的包。所以从 virtualenv 外部删除了包并且它起作用了。

关于python - 无法在 ubuntu 上升级 redis-py 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27019069/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com