Python Virtual Environment and pip for Beginners

  Рет қаралды 26,202

Dave Gray

Dave Gray

Күн бұрын

Web Dev Roadmap for Beginners (Free!): bit.ly/DaveGra...
Python virtual environment and pip for beginners. In this tutorial, you will learn what pip is for and how to use python virtual environments with pip. We will also build a Weather app in a venv virtual environment.
💖 Support me on Patreon ➜ / davegray
⭐ Become a full-stack dev with Zero To Mastery Courses:
- The Complete Python Developer: bit.ly/CompPyt...
- Complete Machine Learning & Data Science: bit.ly/CompMac...
- Junior to Senior Dev Roadmap: bit.ly/WebDevR...
🚩 Subscribe ➜ bit.ly/3nGHmNn
📬 Course Updates ➜ courses.davegr...
❓ Questions - Please post them to my Discord ➜ / discord
☕ Buy Me A Coffee ➜ www.buymeacoff...
👇 Follow Me On Social Media:
Github: github.com/git...
Twitter: / yesdavidgray
LinkedIn: / davidagray
🔗 Source Code: github.com/git...
🔗 Playlist for this Python Course: bit.ly/dg-begi...
Python Virtual Environment and pip for Beginners
(00:00) Intro
(00:05) Welcome
(00:14) Getting Started
(00:33) Installing packages with pip
(02:19) pip list
(02:46) Installing a specific package version
(03:58) Upgrading a package with pip
(04:24) pip uninstall
(04:53) Why do we need virtual environments?
(05:54) Creating a virtual environment
(08:10) Comparing global & virtual environments
(09:30) Packages may install other required packages
(11:01) Python Package Index - PyPI
(11:31) Creating a requirements file
(12:34) .gitignore
(13:30) Weather project
(13:53) Get a login
(14:18) API Key and .env file
(16:18) Get the request URL
(18:25) Complete the Weather project
📚 Tutorial References:
🔗 Python Official Site: www.python.org/
🔗 Visual Studio Code Official Site: code.visualstu...
🔗 Python Module Index: docs.python.or...
🔗 Python Standard Library: docs.python.or...
🔗 Python Package Index (PyPI): pypi.org/
🔗 OpenWeatherMap.org for Weather API
Was this Python tutorial about virtual environments and PIP helpful? If so, please share. Let me know your thoughts in the comments.
#python #venv #pip

Пікірлер: 54
@garrettswenson794
@garrettswenson794 3 ай бұрын
All I needed was to figure out how to install packages on vsc since I only ever used pycharm for months and this was the first video that actually showed me that you have to tap in to "py -m" first, no other videos showed that, so thank you
@liorp4640
@liorp4640 20 күн бұрын
This is great ! Thanks ! For the weather example - I also added a "raise" exception" (following your exception tutorial) in case a city is not found ( weather_data["cod"] == "404")
@jakkdlaw
@jakkdlaw Ай бұрын
perfect tutorial, you really saved me today. The confusion from today's class is gone.
@ahmad-murery
@ahmad-murery Жыл бұрын
You may want to add pip directory to the *Path* system environment variable, this way you can call it directly without adding *py -m* in front of it. I prefer using the *source* command unless I'm in a bad mood I'll use the dot (.) as a shortcut Thanks Dave!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Good additions, Ahmad! I hope you are well my friend!
@ahmad-murery
@ahmad-murery Жыл бұрын
@@DaveGrayTeachesCode little busy but I'm ok, and I hope you're well too. Thanks for asking my friend!
@adriantworek1057
@adriantworek1057 Жыл бұрын
Amazing work Dave! Thank you for this series. I hope you will record some web development stuff with Python (Django or FastAPI) in the near future.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
That's the plan! More Python coming after the beginners series.
@ela2112
@ela2112 9 ай бұрын
Clear and complete. Nicely done. Thanks.
@kcell2042
@kcell2042 Жыл бұрын
Appreciate. The official Python recommendation is pipenv. I'm also looking forward to the Pipenv lesson.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thanks - it seems venv used to be and pipenv just got the recommendation in 2022. I won't double up on these in this series, but maybe another look in the future. The overall concept and goal works with either.
@maxpopov6882
@maxpopov6882 7 ай бұрын
So glad that I stumbled on your channel. Than you very much good sir!
@jamescaleb9676
@jamescaleb9676 5 ай бұрын
awesome. best programming teacher on KZfaq!
@sholle7
@sholle7 2 ай бұрын
Hi Dave! This was very helpful. I am a Python beginner and I find that you explain things that a lot of instructors forget (the curse of knowledge). I do have a question though. As you were typing in the function it showed it created a test. Can you tell me what extension you are using? And do you have any suggestions on extensions?
@michaelscofield5343
@michaelscofield5343 Жыл бұрын
thanks sir, if you could explain some python modules after ending this course ❤.
@nirmesh44
@nirmesh44 Жыл бұрын
Great way to explain as always.
@abuzain859
@abuzain859 Жыл бұрын
i am learning python from udemy when i get stuck I come to KZfaq and search for my favorite content creator Dave Gray to find asolution 😍😍
@kahvelikod
@kahvelikod Ай бұрын
Thank you 👌
@xzex2609
@xzex2609 10 ай бұрын
In windows I could never activate the venv with Source , I just run the activate.bat .
@quaternion-pi
@quaternion-pi 9 ай бұрын
In windows terminal "source .venv\Scripts\activate", "source" was not recognized as a command. ".\.venv\Scripts\activate " starts virtual env. Great tutorial.
@tamangteppiche8344
@tamangteppiche8344 5 ай бұрын
How do i run this with source. It doesn’t work.
@placidaorlunwo5012
@placidaorlunwo5012 2 ай бұрын
I am having challenges installing pakages to the .venv. After I activate and install the installed package doesn't appear in the library. Please how can I resolve this?
@xzex2609
@xzex2609 10 ай бұрын
thank you for your Great work , I think one thing was not clarified at the end and we creates some .gitignore and .env files to protect our API KEY but in the end I didn't understand the next step is just commit the project to git hub ? or there is more to it ? I appreciate if some one help me understand it.
@utinthein7274
@utinthein7274 Жыл бұрын
Thanks you, Sir
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Welcome!
@utinthein7274
@utinthein7274 Жыл бұрын
@@DaveGrayTeachesCode ❤❤ ❤ sir, you reply late. Are you very busy with heavy work. SIR
@johnforeverrules
@johnforeverrules Жыл бұрын
hello dave sir. after python series, are you going to teach django or flask(or both)? thanks in advance for your reply
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
I do plan to. Thanks!
@lorenzasaettone8466
@lorenzasaettone8466 2 ай бұрын
can you prepare a quick tutorial about a web app with flask and API by llm openai. The goal is to answer right to a quiz, and got checked answers, which are not simple yes or nos or fixed words?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 ай бұрын
Nice suggestion! I have a Python Flask REST API tutorial coming up next week. The LLM addition might make a nice follow up.
@lorenzasaettone8466
@lorenzasaettone8466 2 ай бұрын
@@DaveGrayTeachesCode thanx!!! :)
@user-xi6vc3kq2e
@user-xi6vc3kq2e Жыл бұрын
Do you think of creating a NestJS course? We hope so.
@laurentgaume125
@laurentgaume125 4 ай бұрын
Really Great
@tw9535
@tw9535 11 ай бұрын
Damn that's so good! Thank you so much for your time and teaching style! A+ On the virtual environments, if the .py file is stored/run from a different environment (or anyplace else), is there a way at the top of the script to force it to use the python.exe and dependencies in THIS one-- the one (virtual environment) that we just created? That is something about virtual environments that I am not clear on yet. Thank you!
@ram_qr
@ram_qr Жыл бұрын
brilliant as always
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@ledders27
@ledders27 9 ай бұрын
What am I doing wrong? Any help greatly appreciated. from dotenv import load_dotenv Import "dotenv" could not be resolved Pylance I've followed the steps of setting up the virtual environment, I can see in the requirements.txt python-dotenv=1.0.0. I'm using python 3.11.1. This also happens on lesson 23 with dotenv and flask.
@juicymoose9693
@juicymoose9693 5 ай бұрын
i have the same issue, did you ever figure it out?
@ledders27
@ledders27 5 ай бұрын
nope still clueless@@juicymoose9693
@ledders27
@ledders27 5 ай бұрын
Nope, I'm still clueless
@juicymoose9693
@juicymoose9693 5 ай бұрын
@@ledders27 maybe someday we'll know 😔
@raynlaze1339
@raynlaze1339 17 күн бұрын
I have a solution for you guys: 1. Hit ctrl + p in vscode. 2. Type: >Python: select interpreter and select it 3. Click "Enter interpreter path..." 4. Enter the path or click "Find" and browse to the path to ".venv/Scripts/python.exe" (select python.exe) 5. check that this python.exe is now your selected interpreter, it should now work.
@mr.k8660
@mr.k8660 17 күн бұрын
5:54
@khalilbenmeziane8836
@khalilbenmeziane8836 Жыл бұрын
i hope you do django series dave thank you
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@clementbabili6058
@clementbabili6058 7 ай бұрын
Anyone have an issue whereby when you run the py -m venv .venv its gives an error, if so please advise on what to do next.
@hussainalaa2361
@hussainalaa2361 4 ай бұрын
same problem when i give the source command it errors
@alkfjd6313
@alkfjd6313 Ай бұрын
@@hussainalaa2361 If you're using powershell in windows. Try .\.venv\Scritps\activate
@roeesun6758
@roeesun6758 3 ай бұрын
help when i try to activate venv using source it just says source is not recgonized anyone knows how to fix?
@alkfjd6313
@alkfjd6313 Ай бұрын
I got the exactly same error. I saw someone on StackOverFlow saying that source only makes sense in Linux, so you can only use source in bash terminal. But bash terminal throws a "No such file or directory" error.
@radman999
@radman999 5 ай бұрын
What is this Windoze bullshit
Python File Handling for Beginners
22:40
Dave Gray
Рет қаралды 12 М.
The Complete Guide to Python Virtual Environments!
15:52
teclado
Рет қаралды 340 М.
Kids' Guide to Fire Safety: Essential Lessons #shorts
00:34
Fabiosa Animated
Рет қаралды 11 МЛН
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 97 МЛН
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 48 МЛН
Python Virtual Environments - Full Tutorial for Beginners
9:05
Tech With Tim
Рет қаралды 62 М.
Every Developer Needs a Raspberry Pi
27:27
Sam Meech-Ward
Рет қаралды 290 М.
These Coding Projects Give You An Unfair Advantage
14:39
Harkirat Singh
Рет қаралды 345 М.
How to Create a Web Application in Python using Flask
52:52
Dave Gray
Рет қаралды 69 М.
The most important Python script I ever wrote
19:58
John Watson Rooney
Рет қаралды 180 М.
How to Create and Use Virtual Environments in Python With Poetry
14:43
5 Amazing Ways to Automate Your Life using Python
18:40
Internet Made Coder
Рет қаралды 238 М.
Kids' Guide to Fire Safety: Essential Lessons #shorts
00:34
Fabiosa Animated
Рет қаралды 11 МЛН