Configuring docker remote interpreter gives error "Can't create Python SDK"

Answered

I am running PyCharm PE 2017.3 and try to connect to a remote Python interpreter based on Docker.

In the settings dialog PyCharm conforms that I can connect to the remote machine via port 2375 over tcp.

I have selected a python:3.5 image from Red Hat which is available on the Docker VM and can be run remotely via shell command. So this works:

sudo docker run -h tcp:<hostname>:2375 -it --rm <registry-url>/python:3.5 bash

However if in Pycharm I click "OK" in the settings-dialog Pycharm freezes for a while and then an  errorbox appears with title "Can't create Python SDK" and message "Network timed out while trying to connect to https://index.docker.io/v1/repositories/library/busybox/images. You may want to check your internet connection or if you are behind a proxy."

Indeed I am working in an Enterprise environment which has no internet connection, but that should not be necessary because the Python docker image I am using is available in our private Docker registry.

So what do I have to do to get his working?

Any help appreciated

 

4 comments

Hi Dj Van Kuijk! The problem here is PyCharm needs busybox image. Corresponding answer and ticket: https://youtrack.jetbrains.com/issue/PY-26803#focus=streamItem-27-2653525-0-0

0

Hi Pavel

Thank you for your help. I installed the Busybox image on the Docker host and this seems to avoid the previous error. The next error I get is this:

Couldn't refresh skeletons for remote interpreter

failed to run generator3.py for <deleted>.

exit code 127, stderr: ----- python: error while loading shared libraries: libpython3.5m.so.rh-python35-1.0: cannot open shared object file: No such file or directory ---

Any ideas on what is happening here?

0

Hi Pavel,

In my case executing below command will give me a Python prompt as expected.

sudo docker run --rm -it <registry-url>/python:3.5 /opt/rh/rh-python35/root/usr/bin/python

0

Please sign in to leave a comment.