Search code examples
pythonpippython-3.7aiohttp

Pip installation of aiohttp fails with odd AttributeError _dep_map


I'm trying to install aiohttp on a Python 3.7 virtualenv. It's failing with an odd AttributeError when trying to install the yarl dependency.

$ 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/

I tried to look for documented issues in github for aiohttp and yarl but found nothing of sorts.

Also tried to install slightly older versions of yarl (1.0, 1.1, 1.2) but without much luck either.

Any idea what could be the cause of this error?


Solution

  • Upgrading setuptools with pip install -U setuptools fixed the issue.