Creating a virtual environment and file part onvscode

pipenv install django is not creating a virtual environment for me ,i am trying to create a virtual environment via my cmd on my windows , with the command "pipenv intall django", it install django but dont create the enironment , what should i do? and my file part seem not to be working

pipenv intall django was supposed to download django and create an environment but it didnt ..... and copying and pasting a file part on my vscode it says invalid interpreter ....commmand used was "pipenv --venv..." got the file part and append bin\python but it didnt work

One simple solution is not to use pipenv. I recommend you to start creating the virtual environment first and then install Django.

In VSCode, press Ctrl P and then type in ">" to enable the command palete.

After that you see something like this:

enter image description here

Type or press "Python: Create Environment"

Chooses the first option "venv" (the default one): enter image description here

Then chooses your suitable Python version (if you have different version exists on your machine).

Next, all you have to do is open the command line. There should be a "(.venv)" in the beginning of the line in your cmd (meaning the virtual environment is activated):

enter image description here

Finally, you can just install Django via pip:

pip install django

Then Django should be installed properly into your virtual environment.

In case there is any problem with activating the virtual environment, read here for more specific solution.

Back to Top