Setting up a Python virtual environment in 2023

  Рет қаралды 1,885

InfoWorld

InfoWorld

Жыл бұрын

Python uses its "virtual environment" mechanism to let you isolate a project's requirements from other Python projects in your system. Learn in this video how to set up a virtual environment with your project, manage it with pip to add the requirements you need, and what quirks and behaviors you need to know to work with a venv effectively using modern Python.
-----------------------------­---
SUBSCRIBE: kzbin.info_c...
FACEBOOK: / infoworld
TWITTER: / infoworld
WEBSITE: www.infoworld.com/

Пікірлер: 9
@uiiisa
@uiiisa Жыл бұрын
Very clear and useful explanation, thanks.
@cherryxd6849
@cherryxd6849 Жыл бұрын
damn such a good video ty
@HiltonFernandes
@HiltonFernandes Жыл бұрын
I supposed that you were going to comment newer alternatives to venv, like poetry and virtualenv.
@Jubijub
@Jubijub Жыл бұрын
+1, that would have been a more useful video, in particular in combination with pyenv, but also in its own right.
@InfoWorld
@InfoWorld Жыл бұрын
That's an excellent idea, and one worth laying out in a future video. Stay tuned! -Serdar
@CanDoSo_org
@CanDoSo_org 9 ай бұрын
Thanks. But I am always confused with modules. Sometimes I've already installed a module, but it says "Module does not found!" How to install a module which can be used by all environment?
@InfoWorld
@InfoWorld 9 ай бұрын
When you install a module, it's meant to be installed in one environment at a time, to prevent conflicts. This is why pyproject.toml (and before it, requirements.txt) let you automate setting up an environment for a project so you don't have to do that over and over again. Make sure you're installing your requirements to the correct environment, and not to the underlying Python installation either. -Serdar
@CanDoSo_org
@CanDoSo_org 9 ай бұрын
Thanks, Serdar.@@InfoWorld
@moritzmller5761
@moritzmller5761 9 ай бұрын
That's why I hate Python. Does not replicate. On a default Python (3.11) installation on Linux (latest Ubuntu) there is no `py` alias. That's where a beginner would get lost. So if you run `python3 -m venv .env` you get the `.env` folder but you neither get `main.py` nor do you get a `.env/Scripts` folder. Instead you get an `.env/bin` folder. With different `[a|A]ctivate.*` scripts for different shells. You need to know which one to source. Not run! E.g. if you're on zsh or bash the command is `source .env/bin/activate`. But if you're on c-shell it is `source .env/bin/activate.csh` etc. Every time I have to use Python I wonder if it is the P in PITA. :)
How to Create and Use Virtual Environments in Python With Poetry
14:43
The Complete Guide to Python Virtual Environments!
15:52
teclado
Рет қаралды 336 М.
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 35 МЛН
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 63 МЛН
Python 3.13's new JIT and no-GIL modes
6:54
InfoWorld
Рет қаралды 2,5 М.
Python Virtual Environment and pip for Beginners
30:39
Dave Gray
Рет қаралды 24 М.
Build AI Agents in Whatsapp in 30 Minutes | EASY Set-Up
24:32
virtualenv vs. venv (beginner - intermediate) anthony explains #040
11:22
anthonywritescode
Рет қаралды 41 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 343 М.
ASMR Programming - Spinning Cube - No Talking
20:45
Servet Gulnaroglu
Рет қаралды 3,7 МЛН
Python Virtual Environments - Full Tutorial for Beginners
9:05
Tech With Tim
Рет қаралды 56 М.
Anaconda (Conda) for Python - What & Why?
26:10
Academind
Рет қаралды 224 М.
Why Linux Is Better For Programming
13:32
Hallden
Рет қаралды 2,8 МЛН
$1 vs $100,000 Slow Motion Camera!
0:44
Hafu Go
Рет қаралды 28 МЛН
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 456 М.
Как распознать поддельный iPhone
0:44
PEREKUPILO
Рет қаралды 2,2 МЛН