How To Create & Activate A Virtual Environment In Visual Studio Code (Python 3.12)

preview_player
Показать описание
In this video I will be showing you how you can create and activate a virtual environment for Python using Visual Studio code. It's good to know in case you are not using PyCharm since a lot of code editors will not have it created or activated by default.

▶ Become job-ready with Python:

▶ Follow me on Instagram:

00:00 Intro
00:10 Visual Studio Code
00:16 Project setup
00:34 Python 3.12
00:43 What if?
00:51 Error
01:15 Creating a virtual environment
01:48 Activating a virtual environment
02:24 Success!
03:28 One more thing…
03:49 It was that easy
03:54 Let me know what you think
Рекомендации по теме
Комментарии
Автор

This video was really helpful. Thanks!

insight_generator
Автор

man thank you this is what im looking for.

JoanApita
Автор

Thank you, that is very helpful. Is there a way to activate the VENV automatically when a new terminal window is opened?

paulmoss
Автор

thank you, this was simple and easy to follow

larsthomsen
Автор

Hello sir, when i use javascript in vs code and ctrl + s to save my code it will auto help me auto formatting, how can i do the same thing with python (.py file) in vscode

anphanhoang
Автор

It would be nice if you created Best Practices playlist and gather all this tips, like using __name__ == __main__, creating virt env when starting new project etc...

KoljaMineralka
Автор

but how do you keep the venv actively when trying to run the app in debug mode, with the run button in the top right of vs code?

Confusedcapybara
Автор

I prefer to use virtualenv instead of venv from a terminal/cmd/powershell, which is better and faster for some reasons. Some say it's the same, which is not the case at all..
So I've not tried virtualenv inside of VScode and give it a try.

Nordlys
Автор

Personally, in vscode y prefer creating and activating a virtual enviroment using the "create environment" command

pablofueros
Автор

so would using pipenv shell be the same thing or are there any major difference?

prior
Автор

Excuse me, friend, I would like to ask you for help because when I try to create a virtual environment and write the python location in the terminal, I get the following error "Set-location: No position parameter found", just, I would like to know what mistake I made so that it does not detect it

josericardoochoa
Автор

You made it so simple that it instantly became a new muscle memory command...THANKS!!!

NiceChange
Автор

I made some python based tools for our team and had a git repo for it.
Everytime someone new joins, I needed to get them install needed libs and sometime conflicts happen.
Since I found venv, the issue is partially solved.

But now I face the issue on how to manage the venv with git.
A tutorial for that would be appreciated.

gohilurvish
Автор

super helpfull, however one question i have is if I close vs code, how to I get back into the virtual environment(windows)

diegogutierrezraghunath
Автор

It could have been nice if you showed how to deactivate the virtual environment, great video btw ❤

vincentlaizer
Автор

Thanks a ton :) Is there a way to activate the VENV automatically when a new terminal window is opened? (.venv) is not coming when we open Terminal after closing the IDE. @Indently Plz reply

neethugeorge
Автор

it doesn't see pip :( in VS code, even though I installed it in virt env as per tutorial

KoljaMineralka
Автор

Useful content 👍. Venv is good as built-in feature. Personally i prefer Pipenv 😁

krzysiekkrzysiek
Автор

For the virtual environment folder is ".venv" the standard? I have seen some projects use "venv" as the folder name

kishanbsh
Автор

The command for windows doesn't work for me. I've been trying to activate mine in vscode even before you uploaded this video. It says and error message "cannot be loaded be because the running script is disabled in this system"

Despite several stackoverflow questions, it doesn't help still.

Cmd command works fine but powershell doesn't.

KrAsHeDD