emacs-lsp / lsp-python-ms

lsp-mode :heart: Microsoft's python language server
https://emacs-lsp.github.io/lsp-python-ms
BSD 3-Clause "New" or "Revised" License
190 stars 41 forks source link

Using lsp-python-ms with anaconda #53

Open hnisonoff opened 5 years ago

hnisonoff commented 5 years ago

I believe that the packages downloaded in a specific anaconda environment are not being recognized. I have tried to reinstall the package and the server after switching to different conda environments and have not had any success. Do you know what is going on?

seagle0128 commented 5 years ago

Sorry, I don't understand your question completely.

First lsp-python-ms leverages Microsoft Python LangServer while not anaconda. So I guess you want to use the libraries in anaconda, and want lsp-python-ms to recognize and is able to auto complete in Emacs, right? If so I am thinking it's a configuration issue of Python itself. Did you check the envs like PYTHONPATH etc.? One note is you may need exec-path-from-shell to import env vars if you are using macOS.

benbovy commented 5 years ago

You could:

seagle0128 commented 5 years ago

If I understand correctly, conda uses pyls while not mspyls. This request should be making conda to support mspyls.

TheAntimist commented 4 years ago

Well, I use anaconda, and it works fine for me, also you might need to load your python executable envs correctly for it to resolve.

benbovy commented 4 years ago

Well, I use anaconda, and it works fine for me, also you might need to load your python executable envs correctly for it to resolve.

Yes, mspyls works fine too, it picks the right python executable after doing:

YunEr-Wang commented 4 years ago

Well, I use anaconda, and it works fine for me, also you might need to load your python executable envs correctly for it to resolve.

Yes, mspyls works fine too, it picks the right python executable after doing:

  • M-x conda-env-activate (pick your env)
  • M-x lsp or M-x lsp-restart-workspace

Thank you, it works for me too.

a-berg commented 3 years ago

Using pyright here, in my case lsp-restart-workspace after conda-env-activate generates this

Server pyright::<PID> status:starting exited with status signal. Do you want to restart it? (y or n)

Saying y just gives the same problem again.