lsp-python-ms icon indicating copy to clipboard operation
lsp-python-ms copied to clipboard

Using lsp-python-ms with anaconda

Open hnisonoff opened this issue 5 years ago • 7 comments

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?

hnisonoff avatar Aug 15 '19 22:08 hnisonoff

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.

seagle0128 avatar Aug 23 '19 06:08 seagle0128

You could:

  • M-x package-install conda (https://github.com/necaris/conda.el)
  • In a terminal: conda install -n your-env python-language-server -c conda-forge
  • M-x conda-env-activate (pick your env)
  • M-x lsp or M-x lsp-restart-workspace

benbovy avatar Nov 06 '19 16:11 benbovy

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

seagle0128 avatar Nov 06 '19 17:11 seagle0128

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.

TheAntimist avatar Nov 25 '19 17:11 TheAntimist

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

benbovy avatar Dec 17 '19 11:12 benbovy

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.

YunEr-Wang avatar Feb 23 '20 03:02 YunEr-Wang

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.

a-berg avatar Jan 19 '21 18:01 a-berg