-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyright sticks to the first virtual enviroment you open #66
Comments
I'm having the exact same issue using It seems like there's only 1 workspace created, e.g. if I open a file then LSP reports that:
then if I open another file from the other project:
Is that correct? Here it says that the server will ask for configs for each workspace, but that doesn't seem to happen. |
As a workaround, if you set |
I'm running into the same issue. Setting |
Hope this helps someone: I don't fully understand why, but I found that I had to set the
I also had to make sure that projectile understood that the virutalenv were in diferent projects. (This was relevant because they were in the same git repo.) I did this by creating empty After this, it still doesn't work at first: I have to do |
I have multiple python projects with different virtual environments in
<project_root>/venv
directory.With a help of
.dir-locals.el
andprojectile-project-root
, whenever I open a file it will runpyvenv-activate
to the rightvenv
.I have
pyrightproject.json
with"venv": "venv"
inside.However,
pyright
is kinda "sticks" to the environment of the project that was first opened after emacs restart, e.g. if I open a file from project A and then open a file from project B: project B files will have unresolved library imports error because these libraries are not installed in the environment A.What am I missing? Not sure if it is a bug or I just need to tweak
lsp-pyright
/pyrightproject.json
more (I have tried usingexecutionEnvironments
there but behaviour was the same).The text was updated successfully, but these errors were encountered: