Python extension in VSCode cannot see virtual python

38 views Asked by At

I working on a Django project. The problem I have is in the screenshot below:

could not resolved from source

I used "python3 -m venv env" to setup the virtual environment. I also installed Django with the "env" activated. Pip freeze confirms the installation:

requirements

VSCode cannot see virtual python

Below is what I tried to fix this:

  • Reinstalled VSCode
  • Reinstalled the Python extension
  • Manually selected the interpretor with the path "env/bin/python" using "Enter interpretor path..."

The problems will not resolve. I've tried other questions that suggest to simply select to the right interpretor in the virtual environment folder. Didn't work.

I noticed, when I created a virtual environment and activated it from the terminal in VSCode, VSCode did not automatically trigger the suggestion to use it. It's as if VSCode cannot see it at all.

The packages in virtual environment clearly show Django was installed: Django installed

Strangely, the same problem shows in Pycharm too.

0

There are 0 answers