I’m running into an issue installing a specific python package (https://github.com/pazz/alot/) from source using python3 setup.py install --user. The package depends on gpg and gpgme but somehow setuptools does pick up system packages installed in /usr/lib64/python3.8/site-packages. So if I run the above script it tries to install python3-gpg from pypi into ~/.local/lib/python3.8/site-packages/ (which I don’t want because I have the system one installed). If I uninstall the the gpg package in $HOME starting alot fails with
Traceback (most recent call last):
File "/home/jschrod/.local/bin/alot", line 6, in
from pkg_resources import load_entry_point
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3252, in
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
Otherwise I have no problems importing gpg via python e.g.
python3 -m "import gpg"
returns without errors
I suspect this is somehow related to the issue discussed here: https://bugs.python.org/issue1294959 but I don’t have any solution except for maybe adding /usr/lib64/python3.8/site-packages to my PYTHONPATH