How to Install and Run Multiple Python Versions on Ubuntu/Debian | pyenv & virtualenv Setup Tutorial
Вставка
- Опубліковано 10 лип 2024
- This video will show you how to install and run different Python versions on Ubuntu and Debian Linux using pyenv. You will learn to seamlessly switch between multiple Python versions and set specific Python versions for dedicated folders. Additionally, we will set up virtual environments (virtualenv) for your Python projects and use them in Visual Studio Code.
⏬ Get my FREE Python Cheat Sheets: k0nze.gumroad.com
🖥️ pyenv GitHub Repo: github.com/pyenv/pyenv
👉 Website for this Video: k0nze.dev/posts/install-pyenv...
💌 Support me on Patreon: / k0nze
☕️ Buy me Coffee: www.buymeacoffee.com/k0nze
🌍 Check out my Website: k0nze.dev
💻 Join our Discord: discord.k0nze.dev
👔 Follow me on LinkedIn: linkedin.k0nze.dev
Recording Gear
Camera - Sony A6400: geni.us/zRw1
Lens - Viltrox AF 23mm f1.4: geni.us/RVrguGd
Microphone - Rode Wireless Go: geni.us/RBAOIx
Keyboard - Keychron K2 v2: geni.us/DPK87Xn
⏰ Timestamps:
0:00 Intro
0:58 Install pyenv on Ubuntu/Debian Linux
2:29 Install Python through pyenv
3:31 Set global Python version with pyenv
4:25 Install latest Python release candidate with pyenv
5:08 Set a specific Python version for a project
5:49 Using Python virtual environments with pyenv
7:03 Use Python virtual environments in VSCode
8:19 Outro
Download FREE Python Cheat Sheets: k0nze.gumroad.com
this is the only video I've found that actually explains this clearly without skipping steps, thank you good sir.
For anyone getting the error: 'Unable to locate package python-openssl' - you can run the following command in your terminal:
sudo apt install python3-openssl
thank you very much
thanks Tom!
Thanks!
Thank you so much!
Awesome! Thanks
To be honest first time dealing with Linux one the things that frustrated me was the installation of python globally that I almost went back to windows but this tutorial did ti right you deserve more recognition
Thank you for this excellent guide and thank you to everyone who contributed to Pyenv. I just overcame a problem with a set-up script that is really picky about the python version used. Naturally, I encountered this problem while I'm in a hurry, so Pyenv really saved my bacon.
I was looking for pyenv, but in this video I got a lot more than that. Thank you!
I'm happy to hear that the video was helpful for you!
Finally a no nonsense, to the point tutorial. Hope others will soon follow this format. Many thanks for the tutorial man 🙏
Just made my day, huge thx from Spain!
Thank you very much Konze !! Clear and simple. Exactly what I needed.
Great to hear!
Thanks this is exactly what I was looking for!
Thank you very much, exactly what I needed! 😊
exactly what i was looking for. thanks mate!
I'm happy to help!
Great video. Quite helpful in getting it right.
Thanks Konze--Great tutorial
Thanks a lot for the clear explanation!
Very good video! Thanks for that.
Very helpful, thank you very much!
thank you bro for this epic video. it helped me a lot
Really informative !!
I have been looking for installing different version of python on ubuntu 20.04, i found some but whenever i did update-alternatives the terminal wouldn't start. This tutorial was the exact thing that i was looking for, it helped me alot. Thank you so much!
I'm happy that I was able to help you with your problem Aditya!
Thank you k0nze this helper a lot
Sehr hilfreich!!! Thank you
Very helpful!!
Thanks really helpful!
Thanks, good tuto
Helpful !!!!
Muchas gracias hermano, me funcionó. :D
Thank you!
Thank YOu!! subscribed!
I'm happy I could help you James and welcome aboard!
Thsnks alot
Really
Thank you❤️
Helpful, Thank you
You're welcome!
Thank you very much 😍
saved my life brother🙂
Thanks a lot for the amazing tutorial! I followed every step, but I have one question: how to solve pylance 'missing import' even after 'pip install' on .venv?
Thanks for the video ! Btw you can just ‘source ~/.bashrc’ instead of closing and reopening a terminal.
very helpful
I'm glad the video was helpful for you!
Cool.!
Grazie mille.
thanks for this Konze
but
when i write cd "python test"/
its back with wrong or error
there is any help with that
I can't thank you enough.
Thank you
You are welcome Vincent!
very good!!! Can't find good explanations about python environment (not virtenv) on linux. How to manage versions, what are the meaning of having multiple versions and so on. Can you help may be? I just encountered with python errors related to versions and doing something without a deep understanding which is so-so job)
what is the different between local and global directory ?
Sir, How to fix this problem 'Unable to locate package python-openssl' ?
I got same error
Oops! I found solution in this video's comment. It works. :)
I have python installed and I even changed the pyenv global. However, when I write python --version it shows "command python not found." What should I do?
It seems like you havn't added python and/or the pyenv/bin to your PATH variable.
when I use python -V to check the version after setting the global or local version to the one I installed it still shows version 2.7.17
Hi, k0nze! Thank you for your sharing! It's very useful, I hope you can upload more about this theme!
Could I ask a question about VS code? How can I download and open VS in arm64 of the M1 chip? what should I configure about VS? Thanks a lot!
I'm happy you enjoyed the video! You don't need to do anything special to run VSCode on an M1 chip under macOS as VSCode is downloadable as universal binary. If you want to run VSCode on aarch64 under Linux check out the alternative downloads: code.visualstudio.com/#alt-downloads
@@k0nze_builds Thank you for your reply! perhaps there is some confusion. I mean how to download VS in ubuntu with M1 chip. Is it same to download on macOS? Sorry for my expression!
When you run Ubuntu on a Mac the macOS version will not work. It is probably the Linux arm64 version as I pointed out in my answer above. However, I can't confirm this as I don't own an M1 Mac.
@@k0nze_builds Thanks a lot! I will try this
My system's apt is not able to find python-openssl ('Unable to locate package python-openssl').
I went ahead and skipped the package, would there be problems related to this?
Using Ubuntu 21.04
Not having python-openssl available could lead to some errors when installing a package from PyPI that has openssl as a dependency. With Ubuntu 20.04 or 21.04 you could try installing python3-openssl instead.
what I did, which seemed to work was change a portion of the command "...liblzma-dev python-openssl" to "...liblzma-dev python3-openssl". Since, the just python command doesn't seem to work anymore and need to use python3 command instead, I figured that could be the issue.(I use popOS 21.10 btw)
The command I used was:
sudo apt install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl \
git
How to open Pycharm with command line.. please guide
got this error: Paket python-openssl kann nicht gefunden werden >>> can you help? regards
I'm getting an error while running the 1st command
ERROR: ```E: Unable to locate package python-openssl```
I have already downloaded python3-openssl but its not working.
Can anyone help?
I'm getting an error in ubuntu 22 "E: Unable to locate package python-openssl"
It worked when I tried python3-openssl
Yes, you can fix most missing packages in Ubuntu by using the python3 variant instead of just python.
When I tried,it got stuck at "Installing Python-3.8.3..." and there is no progress there after.What should I do?
Have you installed the apt packages?
@@k0nze_builds yeah I did
python dev ecosystem is such a mess. Thanks for this!
I'd like to install and run odoo 13 using pyenv
What's your experience with running odoo under pyenv selected python version? How can I go about installing odoo 13 or 14 using python version of my choice installed via pyenv?
Unfortunately, I haven't worked with oodo yet. I replied to you on Twitter to try to solve your problem over there.
Can anyone help?
I am trying to install Automatic1111 which requires python 3.10
Installed Python-3.10.0 to /home/anarcho/.pyenv/versions/3.10.0
anarcho@LuNoHo:~$pyenv versions
* system (set by /home/anarcho/.pyenv/version)
3.10.0
anarcho@LuNoHo:~$python -m venv .venv
pyenv: python: command not found
I tried python -m venv .venv in both the home directory and in the stable diffusion root folder?
For every 'oo-buhn-too', 'u-buhn-too' and other kinds of '...buhn...'-people: 7fJF5UIS_hE
Very helpful!
I'm happy to hear that this video was helpful for you Jitesh!