Bug 1168795 - setuptools fails to pick up dependencies which do not have egg-info
setuptools fails to pick up dependencies which do not have egg-info
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Development
Current
x86-64 Other
: P5 - None : Normal (vote)
: ---
Assigned To: Matej Cepl
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-06 21:31 UTC by Jochen Schroeder
Modified: 2021-09-08 18:37 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jochen Schroeder 2020-04-06 21:31:18 UTC
I am trying to install alot (https://github.com/pazz/alot/) into my $HOME directory using python3 setup.py install --user. 

The installation does not pick up the installed python3-gpg package in /usr/lib64/python3.8/site-packages and instead tries to install gpg via easy_install into $HOME/.local/lib/python3.8/site-packages. 

If I then remove the user installed gpg package starting alot results in the following error:

Traceback (most recent call last):
  File "/home/jschrod/.local/bin/alot", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3252, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3235, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'gpg' distribution was not found and is required by alot

even though python3-gpg is installed:

$ls /usr/lib64/python3.8/site-packages/gpg                                                

total 992K
4.0K callbacks.py   64K core.py    744K _gpgme.cpython-38-x86_64-linux-gnu.so*  8.0K __init__.py   4.0K results.py  4.0K version.py
   0 constants/    8.0K errors.py  152K gpgme.py                                   0 __pycache__/  4.0K util.py

importing gpg otherwise works fine:
$python3 -c "import gpg"  
exists without error.

This seems to be related to the discussion here: https://bugs.python.org/issue1294959

But as I understand it the python bug in that discussion will adopt what is already done by opensuse, so I'm not quite sure how to fix this.
Comment 1 Jochen Schroeder 2020-04-07 07:04:13 UTC
Changed the title as this is unrelated to lib64 and instead seems to be an issue with there not being a egg-info directory for gpg. 

So it seems that pkg_resources does not pick up modules that do not have a egg-info directory. Because gpg does not have one it is not found by setuptools and hence the error.
Comment 2 Tomáš Chvátal 2020-05-14 09:53:47 UTC
This is correct pip/setuptools behaviour I would say. Anyway assigning to Matej to review.
Comment 3 Matej Cepl 2020-05-14 16:35:14 UTC
First of all, removal of python metadata is overall bad idea. https://build.opensuse.org/request/show/805644
Comment 4 Matej Cepl 2020-06-08 10:03:05 UTC
Update has been prepared, this bug can be closed.