On 11/7/21 13:53, Samuel Thibault wrote:
> Package: python3.9
> Version: 3.9.7-4
> Severity: normal
> 
> Hello,
> 
> In sys.path:
> 
>>>> sys.path
> ['', '/usr/lib/python39.zip', '/usr/lib/python3.9', 
> '/usr/lib/python3.9/lib-dynload', 
> '/home/samy/.local/lib/python3.9/site-packages', 
> '/usr/local/lib/python3.9/dist-packages', '/usr/lib/python3/dist-packages', 
> '/usr/lib/python3.9/dist-packages']
> 
> We can see /usr/local/lib/python3.9/dist-packages, but AIUI,
> 'dist-packages' is meant only for distribution-provided python packages,
> which /usr/local is definitely not about. And indeed, when installing
> some python library with the usual python3 setup.py build / install
> process (e.g. from upstream speech-dispatcher source), the python
> modules are going to /usr/local/lib/python3.9/site-packages, and not
> dist-packages.
> 
> And thus the just-installed python modules are not getting found, and
> people are confused since they did run python3 setup.py properly.
> 
> 
> So it seems that sys.path should be fixed into:
> 
>>>> sys.path
> ['', '/usr/lib/python39.zip', '/usr/lib/python3.9', 
> '/usr/lib/python3.9/lib-dynload', 
> '/home/samy/.local/lib/python3.9/site-packages', 
> '/usr/local/lib/python3.9/site-packages', '/usr/lib/python3/dist-packages', 
> '/usr/lib/python3.9/dist-packages']
> 
> ?

The argument against /usr/local/lib/python3.9/site-packages is, that the very
same location is used for a local python build with the default configure flags,
e.g. ./configure ...

That allows way too easy mixing of locally installed python modules.
Having a /usr/local/lib/python3.9/dist-packages avoids that.

Reply via email to