I have a python application that I installed in WSL ubuntu and I an trying to link my VSCode ( from windows to it). I am having some trouble accomplishing that thou and I hope I can be assisted.
SITUATION
In running a script I need ( in VSCode terminal) I get the following error.
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
(Please note I am in a virtual enviroment).
So then I return to Ubuntu and I run python3 -m django --version
which returns 3.2.8
.
I go back to VSCode virtual environment and run the same script that shows me /mnt/h/Documents/Projects/React/Myplace/venv/bin/python: No module named django
So I think ok maybe I can install it and I run sudo pip install Django==3.2.8
which returns
Requirement already satisfied: Django==3.2.8 in /usr/local/lib/python3.8/dist-packages (3.2.8) Requirement already satisfied: sqlparse>=0.2.2 in /usr/local/lib/python3.8/dist-packages (from Django==3.2.8) (0.4.2) Requirement already satisfied: asgiref<4,>=3.3.2 in /usr/local/lib/python3.8/dist-packages (from Django==3.2.8) (3.4.1) Requirement already satisfied: pytz in /usr/local/lib/python3.8/dist-packages (from Django==3.2.8) (2021.3)
Given this, I am currently unsure how to proceed. I think I should also mentioned I created my virtual enviroment using
sudo pip3 install virtualenv
virtualenv venv
source venv/bin/activate
Any assistance would be appreciated.
Regards
UPDATE
Django not installing in virtualenv I followed this question advice and did the django install in the bin of the virtual enviroment. but it just keeps telling me packages are missing.