Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Using lsp-python-ms with anaconda #53

Open
hnisonoff opened this issue Aug 15, 2019 · 7 comments
Open

Using lsp-python-ms with anaconda #53

hnisonoff opened this issue Aug 15, 2019 · 7 comments

Comments

@hnisonoff
Copy link

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
Copy link
Collaborator

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
Copy link

benbovy commented Nov 6, 2019

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

@seagle0128
Copy link
Collaborator

seagle0128 commented Nov 6, 2019

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

@TheAntimist
Copy link

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
Copy link

benbovy commented Dec 17, 2019

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

@YunEr-Wang
Copy link

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
Copy link

a-berg commented Jan 19, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants