I have been searching for years for someone to explain this in the straightforward manner that you just did. I've quit using Python because of how much virtual environments annoyed me, but I need to get back into Django and you my friend are a life saver.
I had to do an experiment on something that was still bothering me: I had expected that when you change into an environment that you would no longer be in that environment when you left that directory, but following your example and naming the venvs venv_a and venv_b showed me that whatever environment you are in stays that way no matter your directory! I think I understand why it's common to always name the environment "venv", but without seeing it laid out I had no way of knowing...until now that is.
I am working on developing a Kivy Python project for the first time, and this tutorial saved my life. Reading 2D blog posts was not cutting it. Keep up the epic work!!!!
Thank you for the wondeful video. The last step, 'pip install -r requirements.txt' was superb, for the fact that it extracts all the required frameworks in a single command
I know right. The only thing I am confused about is how do you extract it from the virtual environment without using another virtual environment. I tried using the command @13:47 outside the virtual environment to be install in python's site packages and it did not work. I understand what he's talking about, but if I can only use the virtual environment in the command prompt what's the point of using it if I wanted to create a new file ??
@@akeemlouigarde4946 The installation from requirements.txt should work inside and outside of virtual environment. It's just regular installation, but the packages are placed globally. If you wanna test a simple script which does not use any specific dependencies, then there's no need to create a virtual environment, that's fine.
I'm having an error while installing specific version of requests. However there is no problem to go with "pip install requests" (env) C:\Users\semih\Desktop\semih-deneme\p1>pip install requests
thank you for this clear video! I now use venv inside of pycharm. Do you know if venv can work with libraries as tensorflow? I can not install it inside a new venv for the while. thanks for your work!
Wait, so thus means that I should create a venv for every project I do? Do I have to the manually pip install all the packages I need in each? (By manually I mean using the terminal, even if using requirements method shown in the video)
Yes, you *should* use a venv for every project you do. It's actually quite important, that way your app will work no matter which computer it is on (think about if you switch Python versions or you send your code online/to a friend). And yes, you need to manually do "pip install" - I don't think it's too bad, you only do it once (generally) and people always do it when using Node.js
@@naughtrussel5787 I am not talking about python's IDLE in command prompt I am talking about python's IDLE without it. What you said is what the video explained. But without the command prompt it doesn't work. I don't see the point of using a virtual environment if it only works like that.
@@akeemlouigarde4946 That GUI IDLE application runs fine from a virtual env : activate the environment and python -m idlelib.idle , and the window will appear.
Yes, it works with jupyter notebooks as well. You create a venv and activate it, then install ipykernel, launch a command from its docs to create a new kernel. The new kernel will point to your virtual enviromnet and you will be able to switch environments in kernel menu.
I have been searching for years for someone to explain this in the straightforward manner that you just did. I've quit using Python because of how much virtual environments annoyed me, but I need to get back into Django and you my friend are a life saver.
You're welcome that's great to hear
@@dcode-software I just watched it again it was so good!
I had to do an experiment on something that was still bothering me: I had expected that when you change into an environment that you would no longer be in that environment when you left that directory, but following your example and naming the venvs venv_a and venv_b showed me that whatever environment you are in stays that way no matter your directory!
I think I understand why it's common to always name the environment "venv", but without seeing it laid out I had no way of knowing...until now that is.
I am working on developing a Kivy Python project for the first time, and this tutorial saved my life. Reading 2D blog posts was not cutting it. Keep up the epic work!!!!
Thank you for the wondeful video. The last step,
'pip install -r requirements.txt' was superb, for the fact that it extracts all the required frameworks in a single command
The requirements.txt explanation is not what I wanted, but exactly what I needed. Thumbs up.
You're welcome
Best Explanation of virtual environment (2)
Finally some good explanation on this topic. Thank you a lot.
I know right. The only thing I am confused about is how do you extract it from the virtual environment without using another virtual environment. I tried using the command @13:47 outside the virtual environment to be install in python's site packages and it did not work. I understand what he's talking about, but if I can only use the virtual environment in the command prompt what's the point of using it if I wanted to create a new file ??
@@akeemlouigarde4946 The installation from requirements.txt should work inside and outside of virtual environment. It's just regular installation, but the packages are placed globally. If you wanna test a simple script which does not use any specific dependencies, then there's no need to create a virtual environment, that's fine.
This is simply understandable for human(newbie) programmer.
indeed best explanation of virtual environments,greak work
Best explanation of virtual environments I've seen thus far. Great work! Thank you!
That was a very good explanation... thanks man !!
Very nice and clear explanation...Good work..Keep it up
You are uploading videos just as I need them lol
Thanks so much. It's just what I was looking for.
Thanks for the content! One question, does the requirement.txt updates automatically if I pip install a new library?
Hi mate. Very well explained. Excellent video. Thank you!
You're welcome
Fantastic video thanks
helped understand big time!!!
Happy to hear that :)
Very usefull video!
What keyboard did you use when recording this vid? Keys sound good.
CoolerMaster MasterKeys Pro S RGB Cherry MX blue
I'm having an error while installing specific version of requests. However there is no problem to go with "pip install requests"
(env) C:\Users\semih\Desktop\semih-deneme\p1>pip install requests
Thanks alot. Finally grasp the concept. What color theme is that on your vscode? Love it.
No worries. It's been a while but from memory theme used was Ayu:
marketplace.visualstudio.com/items?itemName=teabyii.ayu
You can run batch files from any terminal on windows. Probably need administrator privileges though.
Hi, I do the same thing, but when I type “ import requests”, it gives error and says no module named requests. What can I do?
thank you for this clear video! I now use venv inside of pycharm. Do you know if venv can work with libraries as tensorflow? I can not install it inside a new venv for the while.
thanks for your work!
Wait, so thus means that I should create a venv for every project I do? Do I have to the manually pip install all the packages I need in each? (By manually I mean using the terminal, even if using requirements method shown in the video)
Yes, you *should* use a venv for every project you do. It's actually quite important, that way your app will work no matter which computer it is on (think about if you switch Python versions or you send your code online/to a friend).
And yes, you need to manually do "pip install" - I don't think it's too bad, you only do it once (generally) and people always do it when using Node.js
@@dcode-software thanks! Doesn't this take up a lot of space though?
Thanks sir
How do I use virtual environment in a new file? in python's IDLE (not using command prompt)
you create venv, activate it and launch idle. It will be launched in venv.
@@naughtrussel5787 I am not talking about python's IDLE in command prompt I am talking about python's IDLE without it. What you said is what the video explained. But without the command prompt it doesn't work. I don't see the point of using a virtual environment if it only works like that.
@@akeemlouigarde4946 I feel you have confused some of the terminology.
@@naughtrussel5787 There's IDLE and there's our command prompt that can open python, I'm talking about not opening python with command prompt.
@@akeemlouigarde4946 That GUI IDLE application runs fine from a virtual env : activate the environment and python -m idlelib.idle , and the window will appear.
Thanks friend, or if you prefer, mate
Can this logic be used for Jupyter notebooks as well?
Yes, it works with jupyter notebooks as well. You create a venv and activate it, then install ipykernel, launch a command from its docs to create a new kernel. The new kernel will point to your virtual enviromnet and you will be able to switch environments in kernel menu.
@@naughtrussel5787 thank you. Wish I got this response a year ago.
Hell yeah
Sir please create faucet Rotator in HTML and JavaScript
🔥 🔥 🔥