for people whose "python -V" is showing old version after pyenv shell NEW_PYTHON_VERSION, head over to search bar and type "Manage app execution aliases" and untoggle all the python related thing, check if the command works now in a new terminal, if not then you have to uninstall all the previous instances of python installed from control panel while having already done the first step above. It should solve the issue. Enjoy folks!! Nice video dude
This tutorial rescued me twice. Years ago I managed to install specific python environment using this tutorial. Then I completely forgot what pyenv even is and could not understand why I have old python installed and active even if I removed every python from "add or removed programs".
Thank you so much K0nze!! This tutorial is the best about pyenv in youtube!!! You saved my life a lot of times. The first time I watched it was in 2022 and today you helped me again !! God bless you so much !!!
This was completely necessary for someone like me running full time linux and having to work sometimes on windows with no idea how to even "cd" or "ls -l" on windows. Thank god the powershell has those commands.
Thank you tremendously for this video--you beautifully outlined or "colored-in" what was missing from the GitHub docs to run versions and even virtual environment with VS Code. Brilliant. Thank you. 🙂
Hey there! massive thanks for this tutorial! Seriously, it's hands down one of the best I've come across. Your explanations were super clear, and those ready-made commands? Genius move! Saved me a ton of time and hassle, so cheers for that. Keep up the awesome work, and I'll definitely be keeping an eye out for more of your tutorials
The term 'pyenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. 4:10
Thank you for this great tutorial! Very clear and usefull! :) I am currently working in my master disertation in engineering and I need a way to switch between python versions in a easy way!
I had the problem that I installed the 3.10.8 version in pyenv, but python -V showed me the 3.11.1 version which I had installed directly in my pc. Solved the problem by uninstalling 3.11.1 and installing it in pyenv. Hope it helps someone who has had the same problem
Thank you! I got a problem though, I followed the instructions but when I entered "python -V" it just returned the current python version on my system which is 3.10.1, while I installed and activated the 3.8.2 in pyenv; Can u help me out with this issue?
I get this error> pyenv : The term 'pyenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. And I did exactly what he said in the video. I have windows 11.
Amazing instruction video. Is it possible that you could list out the steps that are 1 time and which steps are to be repeated each time a new virtual environment is needed?
Super hilfreiches Video! Der Teil mit settings.json ist wohl nicht mehr nötig, das macht VSCode mitlerweile automatisch. Allerdings zeigt es im Terminal nicht an, dass man in einer (.venv)ist. Super praktisch und als Anfänger konnte ich jetzt einen simplen pyemv-installer machen, der mir automatisch ein passendes Environment zu meinem Projekt aufsetzt 😊
i watched your Apple version of this tutorial and it worked great. now im trying this version (windows) and when I do the global command and then check the version its still stuck on python 3.12.4 and wont listen to my global command to make it 3.10.11
Thank you for the video. How do see the list of the different virtual environments installed in the system. Can something like pyenv plugin like pyenv- virtualenv or similar be used.
Great video, this has helped me alot. This is something I have struggled with for a while. The only question I have is around installing python packages/modules in the virtual environment such as numpy, scikit, matplotlib etc. Would this be as simple as using pip while in the virtual environment? Are these installed packages persistent when the environment is deactivated and activated again? If not is there a way to have these as a present to be installed every time the venv is activated?
ok so what do I do if I get to pyenv shell, and when i do python -v i get a huge amount of text back - presumably because i have system python on windows that is 3.10 ... i'm trying to do all this so i can run a thing that needs python 3.8
This is a good video and Thanks a lot for sharing this tutorial. But I have a question After we set python 3.10 to the local folder "Python Test" and how to delete that python 3.10 on local?
Thanks, i want to try this because my python 3.10.6 wont download tts from python as a requirement and believe i need 3.9 or lower. I was hoping i could just install a second copy as creating the pyenv and stuff im not sure how thatmworks with oogabooga so i dont lose stabls diffusion python
Is running the command-prompt as admin the same as using powershell? What happens if you already have multiple python versions already installed, before you've installed pyenv? I sometimes have to run a windows setup exe or a whl to install a specific python package.. (for example PyQt 5.4 can't be installed via pip), how would this work with pyenv/virtualenv? I'm actually only interested in building EXEs from 2 python versions.. Python 3.4.4 (32-bit for WinXP) and Python 3.11.1 (64-bit). Would it be easier in my case to just change the PATH whenever I want to switch between? What would pyenv/venv add?
I installed 3.10.6 with the "penv install 3.10.6" but every time i try to swap to it or set it as global it shows me that i am on 3.9.12 afterwards. Is there a way to tell what I did wrong? I want to use python 3.10.6 for Stable diffusion while using a newer version of python for the rest of my system. Is this even the correct way to achieve that? I am here because I tried to install 2 python versions on WIn 10 and while installing python 3.10.6 it just told me that there is already a python verison on my pc so i cant install another. :(
I was with you until 'pyenv shell #' didn't actually change the output of "python -V". '"python local" made the version file but the -V isn't changing.
Thanks for the nice video. One question though: VS code does not recognize the .venv automatically for me, also not after creating settings.json and/or launch.json. I have to select it manually. Are there prerequisites for VS Code to select the .venv automatically?
Hey konze, I have installed 3.10.11 then created a venv. 'pyenv version' gives 3.10.11 but 'python -V' gives output 3.9.7 i tried pyenv global 3.10.11, still python -v is 3.9.7 Can you help with why is this happening?
I'm having issues with an error specified as 'The system cannot execute the specified program'. This happens when I try to run 'pyenv install -l. Is there any way you can help?
Thank you William! I'm glad you enjoyed the video. The default Python version of you system is usually determined by the order of paths in the PATH variable. When you run "python" on the command line the operating system will check the PATH variable if it can find a match. The first match it finds is the default version.
@@k0nze_builds I guess the problem I'm having is that I have 3.7.0 installed on my system, but the pyenv 3.7.0 doesn't recognize my installed libraries i.e. pandas. When I run pip install pandas again it says requirement satisfied (by my system's python)
Each Python version installed through pyenv has its own set of pip packages. This is due to fact, that there might be version conflicts when switching Python versions but keep the packages. Regardless of this I would recommend to create a virtual environment for every new Python project and refrain from install pip packages systemwide.
@@k0nze_builds After many hours of searching online and trying everything I could find, I was unable to get pyenv working on my system. Either I had a 'base' install of python in which case pyenv was not able to change local or shell versions. Or, I had no base installation of python but py.exe would not work and I could only open files using python command in CLI. Actually, pyenv can 'change versions' for a local or shell instance but it doesn't actually execute (like running sys.version_info) I might have to try conda because I just cannot get this to work.
You should not use py.exe to run python code. Always use python.exe because py.exe is a windows thing and can lead to weird behavior (as you have seen yourself).
pyenv allows you to seamlessly switch between Python versions and Python interpreters such as CPython, PyPy, or Stackless Python. A virtual environment is focused on containing packages for your projects to install different package versions for various projects.
For some reason I have Python 3.10.6 installed and after I follow all the instructions and install pyenv, when I run the command "pyenv shell 3.9.6" it takes the command, but then I run "python -V" and still states the 3.10.6. Any suggestions as to why? Outside of that great specific and detailed tutorial. I'm an IT, but mainly I do hardware and software troubleshooting and I’m not too familiar with pyenv or Python, but you definitely explained it in a way I could understand, thanks!
Great tutorial. But how do we manage things like pyinstaller? I have been having trouble getting it to work with versions installed by pyenv and using env PYTHON_CONFIGURE_OPTS = "--enable-shared" does not work with windows.
The one time I worked with pyinstaller and pyenv I created a virtual environment and let pyinstaller get the packages and the interpreter from the virtual environment.
not working when you have already installed python 3.10 and you want to use 3.8.0 i tried to use global but still 3.10 default get what i did pyenv install 3.8.0 pyenv versions pyenv shell 3.8.0 pyenv global 3.8.0 then i open another shell still get 3.10 version which my python default version
Any help with this error? I got this after running the command pyenv CScript Error: Windows Script Host access is disabled on this machine. Contact your administrator for details.
It seems like running scripts is not enabled on your system. When you copy the error message and search for it on Google you can find a lot of tutorials that explain how to enable script execution.
Download FREE Python Cheat Sheets: k0nze.gumroad.com
for people whose "python -V" is showing old version after pyenv shell NEW_PYTHON_VERSION, head over to search bar and type "Manage app execution aliases" and untoggle all the python related thing, check if the command works now in a new terminal, if not then you have to uninstall all the previous instances of python installed from control panel while having already done the first step above. It should solve the issue. Enjoy folks!! Nice video dude
Thank you!
ugh didnt work, i'll have to go uninstall
This tutorial rescued me twice. Years ago I managed to install specific python environment using this tutorial. Then I completely forgot what pyenv even is and could not understand why I have old python installed and active even if I removed every python from "add or removed programs".
Thank you so much K0nze!!
This tutorial is the best about pyenv in youtube!!!
You saved my life a lot of times.
The first time I watched it was in 2022 and today you helped me again !!
God bless you so much !!!
This was completely necessary for someone like me running full time linux and having to work sometimes on windows with no idea how to even "cd" or "ls -l" on windows. Thank god the powershell has those commands.
Probably one of the best tutorial videos i've seen, thank you!!
Glad it was helpful!
Just under 5 minutes in and already an absolutely perfect tutorial, great work!
Thank you, I'm happy you like the video!
thank you. this quick tutorial is very useful - it saved my day indeed - your voice is understandable and clear - which is not so obvious nowadays.
Thank you, for your comment. You made my day!
Thank you tremendously for this video--you beautifully outlined or "colored-in" what was missing from the GitHub docs to run versions and even virtual environment with VS Code. Brilliant. Thank you. 🙂
You can tell this video is good because I have a room temp IQ and I was able to understand this. Well done.
Very helpful tutorial. Now my device able to run multiple versions of python. 👍🏽
I'm you enjoyed the video Nur!
Hey there! massive thanks for this tutorial! Seriously, it's hands down one of the best I've come across. Your explanations were super clear, and those ready-made commands? Genius move! Saved me a ton of time and hassle, so cheers for that. Keep up the awesome work, and I'll definitely be keeping an eye out for more of your tutorials
This is an incredible tutorial. It's straight to the point and tells you everything you need to know to get started. Thank you!
after multiple iterations, it took me this one video to get it right. thank you!
This is very helpful and straight forward! Thank you for your effort on this video!
I'm happy you enjoyed the video!
Thank you! I couldn't follow other vids but yours was the one.
Best video on virtual_env on windows! keep it up, dude!
I can't thank you enough Sir. This is just what I wanted to solve my problem. Also, got to know about pyenv and I'll use it now onward.
You are such an excellent Python master. Awesome job solving this really important topic
great tutorial with thorough explanation. Thanks bud
Thank you so much. This is exactly what I needed. Very easy and straight to the point.
I'm happy I could help you set pyenv up on your system.
Best tutorial (trust me I have gone through a lot and this is the only one that works)
Good video. I was finally able to get this running
Best VENV video out there
Wow, thank you so much for the step by step explanation, it was really helpful!
The term 'pyenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
4:10
Great video!! thanks!! greetings from Cuba!
Thank you for this great tutorial! Very clear and usefull! :) I am currently working in my master disertation in engineering and I need a way to switch between python versions in a easy way!
I'm happy I could help you out with this video Jose! A wish you all the best with your master's thesis project.
Big thumbs up to you. This is amazing. Thanks for making the video
THANK YOU for a great video. HUGE FAN! Liked and Subscribed!
Appreciate the video! Very informative!
You're a monster, really nice video
I had the problem that I installed the 3.10.8 version in pyenv, but python -V showed me the 3.11.1 version which I had installed directly in my pc. Solved the problem by uninstalling 3.11.1 and installing it in pyenv. Hope it helps someone who has had the same problem
Thank you! I had to uninstalled three versions I had in my pc.
Thank you so much man you made it look easier!!!!!!❤❤
Thank you!
I got a problem though,
I followed the instructions but when I entered "python -V" it just returned the current python version on my system which is 3.10.1, while I installed and activated the 3.8.2 in pyenv;
Can u help me out with this issue?
same with me
Mines as well
I fixed it by removing the old python path from the system environment.
@@ItsMe-yr6pj Thank you !! this helped me as well!
Thank U! I've searched a lot for such a wonderful solution
I'm happy I could you with a solution to your problem!
Using the the command pyenv shell 3.7.9 does not change the python version to 3.7.9 rather gives me my default system python version
Same here
Did u find any solution
@@victorvicky5710 I finally used virtual environments. I did not use pyenv again.
Thank you very much. Everything is explained very simply and easily
I'm happy the video was helpful for you!
Really awesome, thank you! Unfortunately am using Git Bash and have to switch to power shell beside that it is perfect.
Thank you, best tutorial!
This saved my rear, thanks a bunch.
thanks for this video. really save my beeware android project.
I am a duffer. And a teacher like you .......
Thanks Sir. simple way to explain.👏👍
I'm always happy to help!
I get this error> pyenv : The term 'pyenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again. And I did exactly what he said in the video. I have windows 11.
11:30 I can't find "Module Debug a python file by invoking it with '-m'"
Thank you very much, was really helpful
THank you so much, does this mean i can select the pyenv as an interpreter in pycharm?
Amazing instruction video. Is it possible that you could list out the steps that are 1 time and which steps are to be repeated each time a new virtual environment is needed?
Super hilfreiches Video!
Der Teil mit settings.json ist wohl nicht mehr nötig, das macht VSCode mitlerweile automatisch. Allerdings zeigt es im Terminal nicht an, dass man in einer (.venv)ist.
Super praktisch und als Anfänger konnte ich jetzt einen simplen pyemv-installer machen, der mir automatisch ein passendes Environment zu meinem Projekt aufsetzt 😊
Clear and well made video. Thank you !
I'm happy the video was helpful for you.
What is the purpose of the launch JSON (at 11:20)?
Maan you are soo good!
this was awesome! i leant a lot!!
I'm happy the video was helpful for you and that you learned some new things!
i watched your Apple version of this tutorial and it worked great. now im trying this version (windows) and when I do the global command and then check the version its still stuck on python 3.12.4 and wont listen to my global command to make it 3.10.11
What's the difference between this and using the python launcher with "py -(version)" on command line? Honest question, I'm curious.
Thank you for the video. How do see the list of the different virtual environments installed in the system. Can something like pyenv plugin like pyenv- virtualenv or similar be used.
Great video, this has helped me alot. This is something I have struggled with for a while.
The only question I have is around installing python packages/modules in the virtual environment such as numpy, scikit, matplotlib etc.
Would this be as simple as using pip while in the virtual environment? Are these installed packages persistent when the environment is deactivated and activated again? If not is there a way to have these as a present to be installed every time the venv is activated?
would you use wsl for python development on windows if you are collaborating with other people on different os?
Using the the command pyenv shell 3.8.6 does not change the python version to 3.8.6 rather gives me my default system python version...how to fix this
Mines as well
ok so what do I do if I get to pyenv shell, and when i do python -v i get a huge amount of text back - presumably because i have system python on windows that is 3.10 ... i'm trying to do all this so i can run a thing that needs python 3.8
This is a good video and Thanks a lot for sharing this tutorial. But I have a question After we set python 3.10 to the local folder "Python Test" and how to delete that python 3.10 on local?
Thanks, i want to try this because my python 3.10.6 wont download tts from python as a requirement and believe i need 3.9 or lower. I was hoping i could just install a second copy as creating the pyenv and stuff im not sure how thatmworks with oogabooga so i dont lose stabls diffusion python
This is a great tutorial on pyenv, thanks very much.
Thank you! I'm glad you enjoyed the video Shay!
Thanks man you fix my problem, th think is that the CurrentUser ExecutionPolicy have to be unrestricted, for me, before the installation work.
it worked like a charm friend :)
I'm happy that it worked out great for you!
Is running the command-prompt as admin the same as using powershell?
What happens if you already have multiple python versions already installed, before you've installed pyenv?
I sometimes have to run a windows setup exe or a whl to install a specific python package.. (for example PyQt 5.4 can't be installed via pip), how would this work with pyenv/virtualenv?
I'm actually only interested in building EXEs from 2 python versions.. Python 3.4.4 (32-bit for WinXP) and Python 3.11.1 (64-bit). Would it be easier in my case to just change the PATH whenever I want to switch between? What would pyenv/venv add?
Thanks for the guide, well made!
I'm happy the video was helpful for you Yanis!
thank you! But what if I haven't admin rights?
what if I want to change the version of python in vscode? What shell I do?
I installed 3.10.6 with the "penv install 3.10.6" but every time i try to swap to it or set it as global it shows me that i am on 3.9.12 afterwards. Is there a way to tell what I did wrong?
I want to use python 3.10.6 for Stable diffusion while using a newer version of python for the rest of my system. Is this even the correct way to achieve that? I am here because I tried to install 2 python versions on WIn 10 and while installing python 3.10.6 it just told me that there is already a python verison on my pc so i cant install another. :(
I was with you until 'pyenv shell #' didn't actually change the output of "python -V". '"python local" made the version file but the -V isn't changing.
Check with get-command maybe you have another version of python that is also in the PATH that is picked up instead
How can i disable temporarily this and use the python installed on the system instead?
Thanks for the nice video. One question though: VS code does not recognize the .venv automatically for me, also not after creating settings.json and/or launch.json. I have to select it manually. Are there prerequisites for VS Code to select the .venv automatically?
GREAT ! Thanks a lot !
Thank you! That was really helpful!
I'm happy I could provide you helpful content
Do we need to install 1 version of python to path so we can install pyenv?
Thank you Sir!
I'm happy to help Gautam!
I don't have Module to launch.json in VS Code
Thanks mate really helpful
I'm happy the video was helpful for you Prateek!
Hey konze, I have installed 3.10.11 then created a venv. 'pyenv version' gives 3.10.11 but 'python -V' gives output 3.9.7
i tried pyenv global 3.10.11, still python -v is 3.9.7
Can you help with why is this happening?
So good. Thank you
sir can u make a tutorial pytorch running for multiple python ?
your video saved me
can you please add a video on how to use python Poetry
I'm having issues with an error specified as 'The system cannot execute the specified program'. This happens when I try to run 'pyenv install -l. Is there any way you can help?
This is a great video. Is there an easy way though to use pyenv to switch to the systems python version?
Thank you William! I'm glad you enjoyed the video. The default Python version of you system is usually determined by the order of paths in the PATH variable. When you run "python" on the command line the operating system will check the PATH variable if it can find a match. The first match it finds is the default version.
@@k0nze_builds I guess the problem I'm having is that I have 3.7.0 installed on my system, but the pyenv 3.7.0 doesn't recognize my installed libraries i.e. pandas. When I run pip install pandas again it says requirement satisfied (by my system's python)
It seems like the pip you run is not the pip coming from pyenv but from the system python installation.
Hey, this actually broke my entire site packages repository. Pip can not access any of the already installed packages. Is there a way to fix this?
Each Python version installed through pyenv has its own set of pip packages. This is due to fact, that there might be version conflicts when switching Python versions but keep the packages.
Regardless of this I would recommend to create a virtual environment for every new Python project and refrain from install pip packages systemwide.
@@k0nze_builds After many hours of searching online and trying everything I could find, I was unable to get pyenv working on my system.
Either I had a 'base' install of python in which case pyenv was not able to change local or shell versions. Or, I had no base installation of python but py.exe would not work and I could only open files using python command in CLI.
Actually, pyenv can 'change versions' for a local or shell instance but it doesn't actually execute (like running sys.version_info)
I might have to try conda because I just cannot get this to work.
You should not use py.exe to run python code. Always use python.exe because py.exe is a windows thing and can lead to weird behavior (as you have seen yourself).
@@k0nze_builds the IDE's all use py.exe
That is not true. Some might use it but definitely not all. Furthermore, a decent IDE lets you change the Python interpreter path.
Thank you a lot. this is very easy and clearly explained vdo. Thank again.
I'm happy this video was helpful for you Preutti!
I already have python 3.11 and did not work for me. In pyenv I see 3.9.6 but normally '> python -v' returns 3.11.0 by the way it was really good
I keep getting "Unable to locate package python-openssl" error when trying to run the pyenv dependencies
Very good and well instructive, thank you very much.
I'm happy you enjoyed the video and that it was helpful for you Jesus!
Is it really safe to set Set-ExecutionPolicy unrestricted?
What's the hardware minimum requirements for?
Does this have any benefits/better features over just using virtualenv? Just curious.
pyenv allows you to seamlessly switch between Python versions and Python interpreters such as CPython, PyPy, or Stackless Python. A virtual environment is focused on containing packages for your projects to install different package versions for various projects.
very good, thanks
For some reason I have Python 3.10.6 installed and after I follow all the instructions and install pyenv, when I run the command "pyenv shell 3.9.6" it takes the command, but then I run "python -V" and still states the 3.10.6. Any suggestions as to why?
Outside of that great specific and detailed tutorial. I'm an IT, but mainly I do hardware and software troubleshooting and I’m not too familiar with pyenv or Python, but you definitely explained it in a way I could understand, thanks!
any update
Hi Konze, great video. I can't see the whole bunch of versions after running the code pyenv install -l. I can see only version 3.10 and 3.11
Uninstall 3.11 from your computer and install it in pyenv, I had the same issue
Great tutorial. But how do we manage things like pyinstaller? I have been having trouble getting it to work with versions installed by pyenv and using env PYTHON_CONFIGURE_OPTS = "--enable-shared" does not work with windows.
The one time I worked with pyinstaller and pyenv I created a virtual environment and let pyinstaller get the packages and the interpreter from the virtual environment.
@@k0nze_builds thank you so much for your response. I will try this.
not working when you have already installed python 3.10 and you want to use 3.8.0 i tried to use global but still 3.10 default get
what i did
pyenv install 3.8.0
pyenv versions
pyenv shell 3.8.0
pyenv global 3.8.0
then i open another shell still get 3.10 version which my python default version
Any help with this error?
I got this after running the command pyenv
CScript Error: Windows Script Host access is disabled on this machine. Contact
your administrator for details.
It seems like running scripts is not enabled on your system. When you copy the error message and search for it on Google you can find a lot of tutorials that explain how to enable script execution.