python - aiohttp 的 Pip 安装失败并出现奇怪的 AttributeError _dep_map

标签 python pip python-3.7 aiohttp

我正在尝试在 Python 3.7 virtualenv 上安装 aiohttp。尝试安装 yarl 依赖项时,它失败并出现奇怪的 AttributeError 错误。

$ pip install aiohttp

Collecting aiohttp                         
  Using cached https://files.pythonhosted.org/packages/33/60/c21acb7002110699761d3dec36fad3f5087c2752a4eb495444f877db6
553/aiohttp-3.5.4-cp37-cp37m-manylinux1_x86_64.whl                                                                    
Collecting multidict<5.0,>=4.0 (from aiohttp)     
  Downloading https://files.pythonhosted.org/packages/88/f0/4d4cbd1a3744e3985efa49682352d0703df653ffa76b81f10fed86599a
50/multidict-4.5.2-cp37-cp37m-manylinux1_x86_64.whl (309kB)                                                           
    100% |████████████████████████████████| 317kB 65.0MB/s
Collecting attrs>=17.3.0 (from aiohttp)                                                                               
  Using cached https://files.pythonhosted.org/packages/3a/e1/5f9023cc983f1a628a8c2fd051ad19e76ff7b142a0faf329336f9a62a
514/attrs-18.2.0-py2.py3-none-any.whl     
Requirement already satisfied: async-timeout<4.0,>=3.0 in /fast/src/mobitroll/merlin/tools/ws/.py37/lib/python3.7/site
-packages (from aiohttp) (3.0.1)
Requirement already satisfied: chardet<4.0,>=2.0 in /fast/src/mobitroll/merlin/tools/ws/.py37/lib/python3.7/site-packa
ges (from aiohttp) (3.0.4)                                              
Collecting yarl<2.0,>=1.0 (from aiohttp)
  Downloading https://files.pythonhosted.org/packages/fb/84/6d82f6be218c50b547aa29d0315e430cf8a23c52064c92d0a8377d7b7357/yarl-1.3.0.tar.gz (159kB)
    100% |████████████████████████████████| 163kB 87.1MB/s
    Complete output from command python setup.py egg_info:                                                            
    Traceback (most recent call last):
      File "<string>", line 1, in <module>    
      File "/tmp/pip-install-od3qiiy3/yarl/setup.py", line 102, in <module>                                           
        setup(**args)          
      File "/fast/src/mobitroll/merlin/tools/ws/.py37/lib/python3.7/site-packages/setuptools/__init__.py", line 142, i
n setup                                                                                                               
        _install_setup_requires(attrs)            
      File "/fast/src/mobitroll/merlin/tools/ws/.py37/lib/python3.7/site-packages/setuptools/__init__.py", line 131, i
n _install_setup_requires   
        (k, v) for k, v in attrs.items()      
      File "/fast/src/mobitroll/merlin/tools/ws/.py37/lib/python3.7/site-packages/setuptools/dist.py", line 442, in __
init__                                                                                        
        k: v for k, v in attrs.items()
      File "/usr/lib/python3.7/distutils/dist.py", line 292, in __init__                                              
        self.finalize_options()              
      File "/fast/src/mobitroll/merlin/tools/ws/.py37/lib/python3.7/site-packages/setuptools/dist.py", line 600, in fi
nalize_options                                                                                                        
        ep.require(installer=self.fetch_build_egg)
      File "/fast/src/mobitroll/merlin/tools/ws/.py37/lib/python3.7/site-packages/pkg_resources/__init__.py", line 236
7, in require                                                                                 
        reqs = self.dist.requires(self.extras)
      File "/fast/src/mobitroll/merlin/tools/ws/.py37/lib/python3.7/site-packages/pkg_resources/__init__.py", line 263
5, in requires                                                             
        dm = self._dep_map
      File "/fast/src/mobitroll/merlin/tools/ws/.py37/lib/python3.7/site-packages/pkg_resources/__init__.py", line 269
1, in __getattr__           
        raise AttributeError(attr)                        
    AttributeError: _dep_map                                                                                          

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-od3qiiy3/yarl/

我尝试在 github 中查找 aiohttpyarl 的记录问题,但没有发现任何问题。

还尝试安装稍旧版本的yarl(1.0、1.1、1.2),但也没有太多运气。

知道这个错误的原因是什么吗?

最佳答案

使用 pip install -U setuptools 升级 setuptools 解决了该问题。

关于python - aiohttp 的 Pip 安装失败并出现奇怪的 AttributeError _dep_map,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54908171/

相关文章:

Python 计时器没有按预期等待

python - 如何在virtualenv中强制安装包?

Python - 重新格式化从 MySQL 返回的元组列表

python - Pandas 中的日期滞后

python - 如何找到这个CNN模型(keras)的ROC曲线和AUC分数

python - 列出所有 Pipenv 环境

python - pip在Windows上安装geopandas

python - mac pip安装mysql-python不成功

python - 从句子中查找并删除一个单词(在单词匹配之间)python

mysql - 无法构建 mysqlclient,Wheel 无法构建。 pip install mysqlclient 不起作用