This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mowgli
Recipients mowgli
Date 2021-01-03.14:09:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609682975.59.0.559934544299.issue42818@roundup.psfhosted.org>
In-reply-to
Content
I encountered the bug when installing a package with `python3 setup.py install --user`. After that, a second installation failed with this stack trace:
```
Traceback (most recent call last):                                                                                                                            
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2191, in _handle_ns                                                                   
    loader = importer.find_spec(packageName).loader                                                                                                           
AttributeError: 'zipimporter' object has no attribute 'find_spec'                                                                                             

During handling of the above exception, another exception occurred:                                                                                           

Traceback (most recent call last):                                                                                                                            
  File "/home/klaus/devel/upstream/pass-git-helper/setup.py", line 1, in <module>                                                                             
    from setuptools import setup                                                                                                                              
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 16, in <module>                                                                          
    import setuptools.version                                                                                                                                 
  File "/usr/lib/python3/dist-packages/setuptools/version.py", line 1, in <module>                                                                            
    import pkg_resources                                                                                                                                      
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3239, in <module>                                                                     
    def _initialize_master_working_set():                                                                                                                     
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3222, in _call_aside                                                                  
    f(*args, **kwargs)                                                                                                                                        
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set                                               
    tuple(                                                                                                                                              
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3265, in <genexpr>                                                                    
    dist.activate(replace=False)                                                                                                                              
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2780, in activate                                                                     
    declare_namespace(pkg)                                                                                                                                    
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2279, in declare_namespace                                                            
    _handle_ns(packageName, path_item)                                                                                                                        
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2196, in _handle_ns                                                                   
    loader = importer.find_spec(packageName)                                                                                                                  
AttributeError: 'zipimporter' object has no attribute 'find_spec'
```

This error happens now also with different tools.

Solution is to `rm -fr ~/.local/lib`. But the next installation triggers the bug again.

The only solution is to install via `python3 setup.py install --user --old-and-unmanageable`.

When I look into the code of zipimport(er), I do not see any find_spec only the old find_loader.

Despite it is a core library, this must be fixed! And with that the name should match the name of the py file to make it able to find the relevant file.
History
Date User Action Args
2021-01-03 14:09:35mowglisetrecipients: + mowgli
2021-01-03 14:09:35mowglisetmessageid: <1609682975.59.0.559934544299.issue42818@roundup.psfhosted.org>
2021-01-03 14:09:35mowglilinkissue42818 messages
2021-01-03 14:09:34mowglicreate