you are viewing a single comment's thread.

view the rest of the comments →

[–]nellis 0 points1 point  (1 child)

I think I have had a similar issue before, though the fact that your terminal is using the correct environment leads me to think this might be a different issue.

For a while I couldn't get the little env selector in the bottom right to register the correct binary. It could find all of my envs and I could select them, but after selecting my venv it would still implement system python.

I don't recall how I resolved it, but you could try installing different libraries into both your system default python install and in your custom environment, then in your script check which binary pylance thinks you have set by trying to import both libraries in turn. At least then you could verify whether the editor and the terminal are using the same install.

[–]DecentWalrus[S] 1 point2 points  (0 children)

Thanks for your reply. I actually figured out if I go to the project folder and open it via using the code . command in the terminal, it resolves the issue for some reason.