Skip to content
Advertisement

VS code not loading Python Interpreter

Here is my VS code infor:

JavaScript

My python path is here:

JavaScript

But VS codes keeps saying Select Python Interpreter in the status bar even after I selected. enter image description here

But when I try to select, it says it is already being selected. At moment, due to this, I am unable to use Python linter Flake8. enter image description here

When I check the console log. I got the following.

JavaScript

But when I go into Python and import sdlc. I am able to. Python/iPython path:

JavaScript

enter image description here Here is what I have in my setting.json

JavaScript

Advertisement

Answer

It turned out that there is some logic goes into $your_conda_env_path/lib/python3.6/site-packages/sitecustomize.py that imports user-defined packages in working repo. But the working directory env variable was not set properly. I created a .env file under repo root dir and added relevant env variables. It resolved the issue.

So in fact all the conda envs were detected. It is just when it tries to load them, it hits ModuleNotFoundError.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement