gpt4 book ai didi

python - 属性错误 : module 'pkg_resources' has no attribute 'safe_name' django channels redis

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

我正在尝试安装 channels_redis 并遇到以下错误。

pip install channels_redis
Collecting channels_redis
Using cached https://files.pythonhosted.org/packages/63/ae/adea3b1913aebb84ec6b6f3c30ba81b8bef79f99b51c7240810284152df4/channels_redis-2.2.1-py2.py3-none-any.whl
Requirement already satisfied: channels~=2.0 in ./env/lib/python3.6/site-packages (from channels_redis) (2.1.1)
Requirement already satisfied: asgiref~=2.1 in ./env/lib/python3.6/site-packages (from channels_redis) (2.3.2)
Collecting msgpack~=0.5.0 (from channels_redis)
Using cached https://files.pythonhosted.org/packages/22/4e/dcf124fd97e5f5611123d6ad9f40ffd6eb979d1efdc1049e28a795672fcd/msgpack-0.5.6-cp36-cp36m-manylinux1_x86_64.whl
Collecting aioredis~=1.0 (from channels_redis)
Using cached https://files.pythonhosted.org/packages/83/4f/fb41fd054522b2f15cf8c9a0b119096a3f2e4db41c9cd7c114da8de742b1/aioredis-1.1.0-py3-none-any.whl
Requirement already satisfied: daphne~=2.1 in ./env/lib/python3.6/site-packages (from channels~=2.0->channels_redis) (2.1.2)
Requirement already satisfied: Django>=1.11 in ./env/lib/python3.6/site-packages (from channels~=2.0->channels_redis) (2.0.6)
Requirement already satisfied: async-timeout<4.0,>=2.0 in ./env/lib/python3.6/site-packages (from asgiref~=2.1->channels_redis) (2.0.1)
Collecting hiredis (from aioredis~=1.0->channels_redis)
Using cached https://files.pythonhosted.org/packages/1b/98/4766d85124b785ff1989ee1c79631a1b6ecfcb444ff39999a87877b2027e/hiredis-0.2.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-aqp5bl02/hiredis/setup.py", line 81, in <module>
'Topic :: Software Development',
File "/usr/lib/python3.6/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/home/danil/projects/python/collann/env/lib/python3.6/site-packages/setuptools/dist.py", line 364, in __init__
self.patch_missing_pkg_info(attrs)
File "/home/danil/projects/python/collann/env/lib/python3.6/site-packages/setuptools/dist.py", line 346, in patch_missing_pkg_info
key = pkg_resources.safe_name(str(attrs['name'])).lower()
AttributeError: module 'pkg_resources' has no attribute 'safe_name'

---------------

answer对我不起作用

pip --version
pip 10.0.1 from project/env/lib/python3.6/site-packages/pip (python 3.6)

最佳答案

只有完全删除环境才有帮助。

deactivate
rm -rf env/
virtualenv env -p python3
. env/bin/activate
pip install -r requirements.txt
pip install channels_redis

关于python - 属性错误 : module 'pkg_resources' has no attribute 'safe_name' django channels redis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51126471/

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