Trying to set up
.dir-locals to use a custom python interpreter inside a container so i can use
run-python and get the REPL inside the container.
I have this setup which seems to partially work in that its trying to use the interpreter i have specified.
((nil . ( (python-shell-interpreter . "/docker:hackdev_django_1:/usr/local/bin/python") )))
However I just get the below error. I assume its something to do with the added slashes.
tramp-error: Not a Tramp file name: "/docker\:hackdev_django_1\:/usr/local/bin/python"
If I use
find-file and navigate to the
bin folder that works, and using the
which command tells me that the path is correct inside the container. So I am at a bit of a loss.
GNU Emacs 25.2.2 Tramp version 188.8.131.52.2 built in
I tried upgrading but I could not convince Emacs to use my downloaded version over the built-in version.
Looking for next thing to try. Is this perhaps a known bug ?
The python shell calculate command runs the docker command through shell-quote-argument which is adding the slashes and breaking things.
I then have to add (setq tramp-histfile-override "/dev/null") to get around another issue where it looks for a history file which does not exist.
Currently running the code below to progress.
(setq tramp-verbose 6) (defun python-shell-calculate-command () "Calculate the string used to execute the inferior Python process." (format "%s %s" python-shell-interpreter python-shell-interpreter-args)) (setq python-shell-interpreter "/docker:hackdev_django_1:/usr/local/bin/python") (setq tramp-histfile-override "/dev/null")
using C-x C-f I can type /docker:hackdev_django_1:/usrlocal/bin/py tab and have it list python.