Closed AirManH closed 2 years ago
Does https://github.com/pythonic-emacs/anaconda-mode/pull/416 fix this for you?
The code below in anaconda-mode.py
cause the server_directory
to be add to the end of sys.path
. Thus it has has a lower priority and is ignored.
One workaround is that
@@ -34,6 +34,7 @@
if not os.path.exists(server_directory):
os.makedirs(server_directory)
site.addsitedir(server_directory)
+sys.path.insert(0, sys.path.pop(-1))
Does #416 fix this for you?
Thank you! I just saw your reply. #416 does the same thing as my workaround.
I just pushed a commit that should fix it then. Please test and close this issue if it's working. Thanks for the detailed bug report.
Fixed in 0546c09.
Problem
If I connect to a docker container with
jedi
already installed, Python will ignore thejedi
installed inserver_directory
, but import the one installed default.Reproduce the problem
Related Emacs configuration
Steps
docker run -i -t pytorch/pytorch:1.9.0-cuda11.1-cudnn8-runtime bash
and installsocat
.C-x C-f /docker:root@{container-id}:{path_to_a_python_file}
The
*anaconda-mode*
buffer shows:Specifications
Host machine:
Docker container:
which conda
gives/opt/conda/bin/conda
which python
gives/opt/conda/bin/python
conda list jedi
gives version 0.17.0ls /root/.emacs.d/anaconda-mode/0.1.14-py3/
showsThus we can know that
anaconda-mode
is using the pre-installedjedi
instead of the one installed in${HOME}/.emacs.d/anaconda-mode/
.