nikolaik/docker-python-nodejs

python-dev is not installed

riverhill527 opened this issue · 2 comments

I check for python-dev its not there

$ apt list --installed | grep python

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libpython-stdlib/now 2.7.16-1 amd64 [installed,local]
libpython2-stdlib/now 2.7.16-1 amd64 [installed,local]
libpython2.7-minimal/now 2.7.16-2+deb10u1 amd64 [installed,local]
libpython2.7-stdlib/now 2.7.16-2+deb10u1 amd64 [installed,local]
libpython3-stdlib/now 3.7.3-1 amd64 [installed,local]
libpython3.7-minimal/now 3.7.3-2+deb10u3 amd64 [installed,local]
libpython3.7-stdlib/now 3.7.3-2+deb10u3 amd64 [installed,local]
python-minimal/now 2.7.16-1 amd64 [installed,local]
python2-minimal/now 2.7.16-1 amd64 [installed,local]
python2.7-minimal/now 2.7.16-2+deb10u1 amd64 [installed,local]
python2.7/now 2.7.16-2+deb10u1 amd64 [installed,local]
python2/now 2.7.16-1 amd64 [installed,local]
python3-distutils/now 3.7.3-1 all [installed,local]
python3-lib2to3/now 3.7.3-1 all [installed,local]
python3-minimal/now 3.7.3-1 amd64 [installed,local]
python3.7-minimal/now 3.7.3-2+deb10u3 amd64 [installed,local]
python3.7/now 3.7.3-2+deb10u3 amd64 [installed,local]
python3/now 3.7.3-1 amd64 [installed,local]
python/now 2.7.16-1 amd64 [installed,local]

for the docker image
nikolaik/python-nodejs:python3.7-nodejs15

Its needed for psycopg2

i get this error

./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory

These images are built on the Docker Official Image packaging for python base image which does not use the debian distributed python package, but instead builds it's own. That's why the python-dev package is not there, and you'll find the header files under /usr/local instead.

$ docker run nikolaik/python-nodejs:python3.7-nodejs15 find / -name Python.h
/usr/local/include/python3.7m/Python.h

My guess is that your are using debian packaged python3 which gives you problems. Weirdly the image contains three python executables, two of them (under /usr/bin/) are for OS purposes and are not intended for use in these images. You should be using the executable at /usr/local/bin/python3 or /usr/local/bin/python which should be at the front of your PATH. How are you running python, are you referencing /usr/bin/python3 somewhere?

If this pops up again, I'll add the above info to the README