I have configured PyCharm to target the Python binary in my Docker container, but am getting this error:
Couldn't refresh skeletons for remote interpreter
failed to run generator3.py for docker://app:latest//usr/local/python/bin/python, exit code 126, stderr: ----- /usr/local/python/bin/python: /usr/local/python/bin/python: cannot execute binary file -----
Running PyCharm 5.0.4 with Docker 1.10.0 in a VM with Python 3.4.3.
Here are my PyCharm Remote Interpreter settings:

Saving those settings gives a Non-zero exit code. and the above error.
In the Dockerfile of your docker image you will probably find an ENTRYPOINT ["bash"] or similar. PyCharm will try to run the interpreter like so :
docker run app:latest /usr/local/python/bin/python
In combination with the ENTRYPOINT that results in the following command within the container:
bash /usr/local/python/bin/python
From that the error message makes sense. If you have control over the Dockerfile you can either change the ENTRYPOINT to CMD or - if that's not an option for you - change the entrypoint so that it can work with /usr/local/python/bin/python as parameter and do the right thing with it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With