I\'m starting with Docker, but I don\'t know how to configure PyCharm to use a python interpreter located in a container.
It was easy to setup with Vagrant, but there\'s
In order to avoid any SSH overhead (which makes perfect sense with Docker), docker exec definitely seems to be the way to go.
Unfortunately I couldn't get it to work so far. It would be great if someone could fill in the blanks. Here is what I did (using PyCharm 4.0.4 and Docker 1.4.1):
Create a file named python_myproject.sh
containing the following:
#!/bin/bash
docker exec -i myproject_container /path/to/containers/python2.7
Note that the file's name has to begin with python
otherwise PyCharm will complain.
In PyCharm's settings, under Project Interpreter
, add a new local interpreter. Give it the path to your python_myproject.sh
file.
This is where I'm stuck. After a quite long loading time (the throbber says "Setting up library files"), a window entitled "Invalid Python SDK" appears and says:
Cannot set up a python SDK
at /path/to/python_myproject.sh.
The SDK seems invalid.
In ~/.PyCharm40/system/log/.idea
:
2015-02-19 17:33:30,569 [ 166966] WARN - ution.process.OSProcessHandler - Cannot kill process tree. Trying to destroy process using Java API. Cmdline:
2015-02-19 17:34:30,628 [ 227025] WARN - ution.process.OSProcessHandler - Cannot kill process tree. Trying to destroy process using Java API. Cmdline:
2015-02-19 17:34:30,653 [ 227050] INFO - rains.python.sdk.PythonSdkType -
Timed out