Python Tutorial: VENV (Windows) - How to Use Virtual Environments with the Built-In venv Module

Python Tutorial: VENV (Windows) - How to Use Virtual Environments with the Built-In venv Module

Corey Schafer

5 лет назад

562,951 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Corey Schafer
Corey Schafer - 02.04.2019 18:34

In my older virtualenv video, I got a ton of requests to show how to use virtual environments on Windows. I hope this helps!

Ответить
IamRaf
IamRaf - 10.10.2023 02:08

Thank you, that was really informative! Clears up questions.

Ответить
joe kavin kumar
joe kavin kumar - 09.10.2023 10:24

when i passed the requirements.txt file its showing as error could not open requirements file(no such file or directory)

Ответить
PC suzuya
PC suzuya - 13.08.2023 02:29

you are awesome i don't have words to describe how helpful this video was thanks alooot man

Ответить
Robel Asefa
Robel Asefa - 12.08.2023 21:17

Great!

Ответить
Cssaarr
Cssaarr - 06.08.2023 03:32

AMAZING video. Thanks a lot.

Ответить
yeast
yeast - 17.07.2023 18:18

Great video, thanks

Ответить
Prateek Upadhya
Prateek Upadhya - 11.07.2023 20:51

Amazing tutorial - No one explains it like you do Corey!

Ответить
David K
David K - 05.07.2023 04:03

Please sir, remake video in Hindi

Ответить
OnePercentDaily
OnePercentDaily - 13.06.2023 05:40

Even after 4 years, it is still a valid a video 😍

Ответить
Francis Guchie
Francis Guchie - 24.05.2023 14:01

This video is a simplified as a sip on a cup of coffee thank you so much Corey

Ответить
Bonk Shiba
Bonk Shiba - 19.05.2023 18:28

good explanation

Ответить
Ria de Vera
Ria de Vera - 15.05.2023 09:50

Thank you so much! I’ve searched and read and tried everything on the net on how to set up venv but this is the only one that worked.

Ответить
Eduardo Prioli Novaes
Eduardo Prioli Novaes - 02.05.2023 19:40

Thanks a lot!

Ответить
Abdul-Kareem Abdul-Rahman
Abdul-Kareem Abdul-Rahman - 10.04.2023 16:56

how would one upgrade the phyton in a virt environment? thanks?

for instance my system wide python says it is 3.11.3 but my venv says it is 3.7.

wld be grateful for any help or signposting

Ответить
computer brand
computer brand - 09.04.2023 16:17

Thanks for tips sir.

I have created a virtual env and trying to install pandas in that but it's picking up my global pandas package and not including it in the virtual env.

Could you please help me with it.

pip list --local

Package Version
---------- -------
pip 23.0.1
setuptools 60.2.0
wheel 0.37.1

pip install pandas

Requirement already satisfied: pandas in c:\users\<username>\appdata\local\programs\python\python310\lib\site-packages (1.5.2)
Requirement already satisfied: pytz>=2020.1 in c:\users\<username>\appdata\local\programs\python\python310\lib\site-packages (from p
andas) (2022.7)
Requirement already satisfied: numpy>=1.21.0 in c:\users\<username>\appdata\local\programs\python\python310\lib\site-packages (from
pandas) (1.24.0)
Requirement already satisfied: python-dateutil>=2.8.1 in c:\users\<username>\appdata\local\programs\python\python310\lib\site-packag
es (from pandas) (2.8.2)
Requirement already satisfied: six>=1.5 in c:\users\<username>\appdata\local\programs\python\python310\lib\site-packages (from pytho
n-dateutil>=2.8.1->pandas) (1.16.0)

Ответить
bayan bishara
bayan bishara - 01.04.2023 21:30

when I try to run (cd Desktop) it shows:The system cannot find the path specified. it works with documents and downloads but not desktop, anyone has an idea how to deal with this?

Ответить
Taylor McCoy
Taylor McCoy - 29.03.2023 02:39

How can he call pip from his desktop? I cannot. This is like the 13th video I've looked at trying to figure out why no matter what I do I can't do simple commands from my command prompt. I know my python is installed in program folder but it seems to do me no good. This is so frustrating lol.

Ответить
Jetter Garcia
Jetter Garcia - 26.03.2023 10:51

how can i change the python version for the virtual environment?

Ответить
Deepti Shukla
Deepti Shukla - 21.03.2023 21:23

Hi... How do i run the python scripts in venv

Ответить
Samar Hussain
Samar Hussain - 21.03.2023 17:43

This is the best venv tutorial that I've ever seen. Its bookmarked in my browser for over 1.5 years now. I get back to it whenever I miss something. Thanks man (y)

Ответить
Ged Toon
Ged Toon - 13.03.2023 16:56

I know this is 3 years old now. If you right click on the desktop and choose 'open in terminal you will see a power shell terminal. To activate python you need to type project_env\Scripts\Activate.ps1 and to use 'where' you need to type where.exe python

Ответить
Dionis Muzenidis
Dionis Muzenidis - 09.02.2023 17:50

You are so fast, I don't even need to set x2 speed. 👍

Ответить
Let's Cackle Online!
Let's Cackle Online! - 27.01.2023 20:47

I initially learned all of this in another environment and I have no clue how to get back there. At least this one has minesweeper

Ответить
Paradoxical Egg
Paradoxical Egg - 21.01.2023 07:32

Amazing tutorial!

Ответить
Loránd B
Loránd B - 05.01.2023 12:09

first step already wrong, there is no pip installed

Ответить
Teklehaimanot Aman
Teklehaimanot Aman - 21.12.2022 12:25

Thank you Corely for your outstanding tutorials.
I am wondering if we could create virtual enviroment in drive where python is not located. In my case, python is installed in C drive and my data science projects are in D drive. I want to create a virtual enviroment in each of my projects. Is that possible please?

Ответить
Joey Zalman
Joey Zalman - 16.12.2022 16:59

Very clear thank you!

Ответить
negin madani
negin madani - 15.12.2022 17:27

the best video I have ever seen

Ответить
Vishal Jain
Vishal Jain - 09.12.2022 14:32

this isnt your first time here...

Ответить
James S
James S - 09.12.2022 04:16

clutch

Ответить
le-pain
le-pain - 01.12.2022 14:08

I just wanna say tank you!

Ответить
K A L Y A N
K A L Y A N - 24.11.2022 13:01

Hi, I have python-3.10 installed in my PC, but I want use RASA so I should use 3.7 for that So,
Can we create an environment with 3.7 version of python , when that version of python is not even installed in my main system ??

Ответить
Suraj Oberai
Suraj Oberai - 16.11.2022 17:58

if someone getting error like "the module VIRTUALENV_NAME can't be loaded" , try the following commands:

1. Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
2. VIRTUALENV_NAME\bin\Activate.ps1

PS: python version is 3.10

Ответить
polakpuckstopper
polakpuckstopper - 29.10.2022 05:43

superb video that provided me with everything I needed - no more, no less. thanks so much!

Ответить
Rei
Rei - 20.10.2022 17:30

when i run the line python -m venv project_env it doesn't create the directory, can you help me?

Ответить
Vivian
Vivian - 03.10.2022 22:59

Very well explained. So grateful for these videos. 🙏

Ответить
Jeff Skoldberg
Jeff Skoldberg - 03.10.2022 20:35

You're right, is is simple and doesn't have the bells and whistles of pipenv. The one thing I really prefer in pipenv is your pipfile is update automatically. Here, you would have to remember to add something to your requirements.txt after you install it.

Ответить
Miguel Fernandes
Miguel Fernandes - 16.09.2022 17:06

Thank you so much, this video is perfect !!

Ответить
Chapel Heel
Chapel Heel - 28.08.2022 01:40

Just a head's up before you drive yourself crazy, but the pip stuff here seems outdated. The pip list stuff does not work at all (you'll just get the global list of packages, not the ones in your environment), and you also may find your pip installs do not work to install directly to the environment. I drove myself crazy thinking I was missing something here, but I think it just doesn't work anymore. (I'm not bashing the creator...I just think some of this is now N/A).

Ответить
Akku Dhure
Akku Dhure - 26.08.2022 10:12

thank you for the video, really helpful :)

Ответить
Seyitali Yetimoglu
Seyitali Yetimoglu - 10.08.2022 07:41

Hi there, first of all, it's an excellent video also can you please enable subtitles? Thank you so much!

Ответить
Handsome Person
Handsome Person - 06.08.2022 14:07

ive been coding in python for 2+ years now and i just came across this video and feuture and im a tottal idiot for not knowing this for the 2+ years ive been randomly downloading packages and bloating my system. ;(

Ответить
another small potato passing by
another small potato passing by - 02.08.2022 16:24

I know it's like throwing a bottle in the ocean but when I create my env using venv, it doesn't create a Scripts file into it but only lib, bin and include. It seems that the activate file is in bin, but when I run project_env\Scripts\activate.bat, the prompt returns: 'activate.bat' is not recognized as an internal or external command, an executable file or a command file.
What should I do to activate my environment?

Ответить
legends talk
legends talk - 21.07.2022 00:17

Gooooooood 👌🏻

Ответить
Nigele McCoy
Nigele McCoy - 19.07.2022 23:49

This guy is the GOAT, simple and easy tutorials! This helps alot!

Ответить