Two different python 3.11 binaries in python:3.11
piotr-piatkowski opened this issue · comments
Piotr Piatkowski commented
Not only there're two python3 binaries in the image, but they have different paths - so when I add libraries with one of them, the other will not see them. Is there any point for having two binaries?
$ docker run -ti --rm python:3.11 bash
root@698d29473fa1:/# /bin/python3 -c 'import sys; print(sys.path)'
['', '/usr/lib/python311.zip', '/usr/lib/python3.11', '/usr/lib/python3.11/lib-dynload', '/usr/local/lib/python3.11/dist-packages', '/usr/lib/python3/dist-packages']
root@698d29473fa1:/# /usr/local/bin/python3 -c 'import sys; print(sys.path)'
['', '/usr/local/lib/python311.zip', '/usr/local/lib/python3.11', '/usr/local/lib/python3.11/lib-dynload', '/usr/local/lib/python3.11/site-packages']
Laurent Goderre commented
Good find! This is caused by the image using buildpack-dev as a base for debian variants.
Laurent Goderre commented
I guess this is a known fact: https://github.com/docker-library/python/blob/master/3.11/bookworm/Dockerfile#L9
yosifkit commented
Yeah, we have a blurb in the Docker Hub docs: https://github.com/docker-library/docs/tree/bdda88abccb401344c969c344f730405a91337da/python#multiple-python-versions-in-the-image