Bug#962665: python3: System site-packages directory not in sys.path breaking mechanism for pip3 install from source

2021-08-23 Thread Alex Volkov
I fail to see any logic in the explanation given at #765022. So, because of 
infinitesimal number of users who, for some weird reasons, want to install 
Python3 interpreter from source, everyone else has to just symlink /usr/local/
site-packages and /usr/local/dist-packages together, breaking *both* the 
standard approach described in the upstream documentation, and your 
"sophisticated" separation scheme. This is what I did just now, as I needed to 
install a third-party app with its provided setup.py, the author of which 
surely was able to read official docs and so the libs used by the app and built 
from the source naturally fell into /usr/local/lib/site-extensions. The fact I 
used Debian-provided Python3 interpreter for this task doesn't make those libs 
"provided by Debian distributive", they are NOT.



Bug#962665: python3: System site-packages directory not in sys.path breaking mechanism for pip3 install from source

2020-06-14 Thread Matthias

> did you use pip3 from Debian or upstream?

It is pip3 from Debian installed via python3-pip package:
pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

> [¹] https://wiki.debian.org/Python#Deviations_from_upstream
>
> so… if you're using our pip3, then there's a bug (it should install into
> dist-packages ...

I'm a little surprised, that the modules installed from source with pip3
should be placed in the same folder, as the modules installed via *.deb
packages.
As I understand the wiki article, dist-packages was chosen to separate
python modules installed via Debian packages from packages, that were
installed from source.

So the same approach why /usr/ and /usr/local/ exists.

When this is the wanted behavior, than fine, at least it will work.



Am 12.06.20 um 10:33 schrieb Piotr Ozarowski:

[Matthias, 2020-06-11]

after installing a python package (radiotray) from source with pip3 (sudo pip3
install .) The package is not listed by pip3 (pip3 list), nor can it be
imported.


did you use pip3 from Debian or upstream?


When checking manually the files a located under: /usr/lib/python3.6/site-
packages/radiotray
But this path is missing in the sys.path of python3:

[...]

So please add the site-packages directory under /usr to the sys.path of
python3.


this will never happen, we removed site-packages for a good reason¹

[¹] https://wiki.debian.org/Python#Deviations_from_upstream

so… if you're using our pip3, then there's a bug (it should install into
dist-packages even if user used the
--I-know-it-s-stupid-but-please-use-sudo-and-break-my-system option)
If not (i.e. you used pip3 from outside Debian) then there's nothing we
can do.





Bug#962665: python3: System site-packages directory not in sys.path breaking mechanism for pip3 install from source

2020-06-12 Thread Piotr Ozarowski
[Matthias, 2020-06-11]
> after installing a python package (radiotray) from source with pip3 (sudo pip3
> install .) The package is not listed by pip3 (pip3 list), nor can it be
> imported.

did you use pip3 from Debian or upstream?

> When checking manually the files a located under: /usr/lib/python3.6/site-
> packages/radiotray
> But this path is missing in the sys.path of python3:
[...] 
> So please add the site-packages directory under /usr to the sys.path of
> python3.

this will never happen, we removed site-packages for a good reason¹

[¹] https://wiki.debian.org/Python#Deviations_from_upstream

so… if you're using our pip3, then there's a bug (it should install into
dist-packages even if user used the
--I-know-it-s-stupid-but-please-use-sudo-and-break-my-system option)
If not (i.e. you used pip3 from outside Debian) then there's nothing we
can do.



Bug#962665: python3: System site-packages directory not in sys.path breaking mechanism for pip3 install from source

2020-06-11 Thread Matthias
Package: python3
Version: 3.6.7-1~18.04
Severity: important

Dear Maintainer,

after installing a python package (radiotray) from source with pip3 (sudo pip3
install .) The package is not listed by pip3 (pip3 list), nor can it be
imported.

When checking manually the files a located under: /usr/lib/python3.6/site-
packages/radiotray
But this path is missing in the sys.path of python3:

python3 -m site
sys.path = [
'/home/mat',
'/usr/lib/python36.zip',
'/usr/lib/python3.6',
'/usr/lib/python3.6/lib-dynload',
'/home/mat/.local/lib/python3.6/site-packages',
'/usr/local/lib/python3.6/dist-packages',
'/usr/lib/python3/dist-packages',
]
USER_BASE: '/home/mat/.local' (exists)
USER_SITE: '/home/mat/.local/lib/python3.6/site-packages' (exists)
ENABLE_USER_SITE: True

I am aware of the circumstance that debian place the python module installed as
deb package under dist-packages, but this should not prohibit the usage of pip3
for system wide python modules.

A similar bug issue is: https://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=765022
Sadly this issue was archived without solving the problem.

So please add the site-packages directory under /usr to the sys.path of
python3.
Propably the following patch need to be adapted to fix this issue:
https://salsa.debian.org/cpython-
team/python3/-/blob/master/debian/patches/sysconfig-debian-schemes.diff

After adding the site-packages directory to the sys.path it should be possible
to use pip3 for install modules system wide.

Cheers Matthias



-- System Information:
Debian Release: buster/sid
  APT prefers bionic-updates
  APT policy: (500, 'bionic-updates'), (500, 'bionic-security'), (500, 
'bionic'), (100, 'bionic-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-101-generic (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages python3 depends on:
ii  libpython3-stdlib  3.6.7-1~18.04
ii  python3-minimal3.6.7-1~18.04
ii  python3.6  3.6.9-1~18.04ubuntu1

python3 recommends no packages.

Versions of packages python3 suggests:
pn  python3-doc   
pn  python3-tk
pn  python3-venv  

-- no debconf information