我在运行qq-botpy的时候,想利用Python的Redis包来管理数据库
在安装redis后,botpy报错提示需要的async-timeout版本为3.0-4.0,但是Redis包需求的async-timeout版本为>4.0
C:\Users\afanm>pip install --upgrade async-timeout
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Requirement already satisfied: async-timeout in d:\python\lib\site-packages (3.0.1)
Collecting async-timeout
Using cached http://mirrors.aliyun.com/pypi/packages/d6/c1/8991e7c5385b897b8c020cdaad718c5b087a6626d1d11a23e1ea87e325a7/async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Installing collected packages: async-timeout
Attempting uninstall: async-timeout
Found existing installation: async-timeout 3.0.1
Uninstalling async-timeout-3.0.1:
Successfully uninstalled async-timeout-3.0.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
aiohttp 3.7.4.post0 requires async-timeout<4.0,>=3.0, but you have async-timeout 4.0.2 which is incompatible.
Successfully installed async-timeout-4.0.2
更新完成后,Redis不再提示依赖版本问题,运行botpy开始报错
PS C:\Users\afanm> & D:/Python/python.exe "d:/Desktop/新建 文本文档.py"
Traceback (most recent call last):
File "d:\Desktop\新建 文本文档.py", line 1, in <module>
import botpy
File "D:\Python\lib\site-packages\botpy\__init__.py", line 3, in <module>
from .client import *
File "D:\Python\lib\site-packages\botpy\client.py", line 7, in <module>
from .api import BotAPI
File "D:\Python\lib\site-packages\botpy\api.py", line 9, in <module>
from .http import BotHttp, Route
File "D:\Python\lib\site-packages\botpy\http.py", line 7, in <module>
import aiohttp
File "D:\Python\lib\site-packages\aiohttp\__init__.py", line 6, in <module>
from .client import (
File "D:\Python\lib\site-packages\aiohttp\client.py", line 35, in <module>
from . import hdrs, http, payload
File "D:\Python\lib\site-packages\aiohttp\http.py", line 7, in <module>
from .http_parser import (
File "D:\Python\lib\site-packages\aiohttp\http_parser.py", line 15, in <module>
from .helpers import NO_EXTENSIONS, BaseTimerContext
File "D:\Python\lib\site-packages\aiohttp\helpers.py", line 667, in <module>
class CeilTimeout(async_timeout.timeout):
TypeError: function() argument 'code' must be code, not str
再重新安装botpy后,将已有的async-timeout降级为3.x,botpy正常使用
如果我要使这Botpy和redis可以共存使用,我该如何解决依赖版本冲突问题?
劳烦各位解答,感谢!