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

КОМЕНТАРІ • 87

  • @k0nze_builds
    @k0nze_builds  2 роки тому +1

    Download FREE Python Cheat Sheets: k0nze.gumroad.com

  • @carlosduclaud9562
    @carlosduclaud9562 7 днів тому

    this is the only video I've found that actually explains this clearly without skipping steps, thank you good sir.

  • @tomnewton3191
    @tomnewton3191 Рік тому +21

    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

  • @Bad_B0nes
    @Bad_B0nes Рік тому +7

    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

  • @MrOttman001
    @MrOttman001 11 місяців тому +1

    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.

  • @the12thunique89
    @the12thunique89 2 роки тому +1

    I was looking for pyenv, but in this video I got a lot more than that. Thank you!

    • @k0nze_builds
      @k0nze_builds  2 роки тому

      I'm happy to hear that the video was helpful for you!

  • @AKhan-oz9hw
    @AKhan-oz9hw 2 місяці тому

    Finally a no nonsense, to the point tutorial. Hope others will soon follow this format. Many thanks for the tutorial man 🙏

  • @bernidotoraya
    @bernidotoraya Рік тому

    Just made my day, huge thx from Spain!

  • @bernardleclerc3801
    @bernardleclerc3801 2 роки тому +5

    Thank you very much Konze !! Clear and simple. Exactly what I needed.

  • @scuzzyhoulihan9853
    @scuzzyhoulihan9853 Рік тому

    Thanks this is exactly what I was looking for!

  • @bhnienhuis
    @bhnienhuis Рік тому

    Thank you very much, exactly what I needed! 😊

  • @jageerthanjegadeeswaran6353
    @jageerthanjegadeeswaran6353 2 роки тому +1

    exactly what i was looking for. thanks mate!

  • @vimalneha
    @vimalneha 11 місяців тому

    Great video. Quite helpful in getting it right.

  • @ScottCov
    @ScottCov Рік тому

    Thanks Konze--Great tutorial

  • @rajv4509
    @rajv4509 11 місяців тому

    Thanks a lot for the clear explanation!

  • @Kaemer1000
    @Kaemer1000 Рік тому

    Very good video! Thanks for that.

  • @joseeyzaguirre3406
    @joseeyzaguirre3406 Рік тому

    Very helpful, thank you very much!

  • @devbazregari8879
    @devbazregari8879 Рік тому

    thank you bro for this epic video. it helped me a lot

  • @mi9807
    @mi9807 Рік тому

    Really informative !!

  • @adityakulkarni5699
    @adityakulkarni5699 2 роки тому +4

    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!

    • @k0nze_builds
      @k0nze_builds  2 роки тому +2

      I'm happy that I was able to help you with your problem Aditya!

  • @watchhumans989
    @watchhumans989 Рік тому

    Thank you k0nze this helper a lot

  • @ScottCov
    @ScottCov Рік тому

    Sehr hilfreich!!! Thank you

  • @Rho_ohm
    @Rho_ohm 9 місяців тому

    Very helpful!!

  • @GadgeteerZA
    @GadgeteerZA 9 місяців тому

    Thanks really helpful!

  • @-boubakerabdallah8380
    @-boubakerabdallah8380 Рік тому

    Thanks, good tuto
    Helpful !!!!

  • @asfranj
    @asfranj 2 роки тому

    Muchas gracias hermano, me funcionó. :D

  • @SwagatMalla
    @SwagatMalla Місяць тому

    Thank you!

  • @smarttradzt4933
    @smarttradzt4933 2 роки тому +1

    Thank YOu!! subscribed!

    • @k0nze_builds
      @k0nze_builds  2 роки тому

      I'm happy I could help you James and welcome aboard!

  • @amirhosseinghasemi4177
    @amirhosseinghasemi4177 Рік тому

    Thsnks alot
    Really
    Thank you❤️

  • @vuthyyib2001
    @vuthyyib2001 2 роки тому +1

    Helpful, Thank you

  • @user-vy4vk6in7t
    @user-vy4vk6in7t Рік тому

    Thank you very much 😍

  • @arjavkanadia9730
    @arjavkanadia9730 5 місяців тому

    saved my life brother🙂

  • @sillywalker2992
    @sillywalker2992 Рік тому +1

    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?

  • @slash7682
    @slash7682 Рік тому

    Thanks for the video ! Btw you can just ‘source ~/.bashrc’ instead of closing and reopening a terminal.

  • @TheM00ntasir
    @TheM00ntasir 2 роки тому +1

    very helpful

    • @k0nze_builds
      @k0nze_builds  2 роки тому

      I'm glad the video was helpful for you!

  • @alejandrohdo
    @alejandrohdo 2 роки тому +1

    Cool.!

  • @MertStack
    @MertStack Місяць тому

    Grazie mille.

  • @ahmedatia3401
    @ahmedatia3401 Рік тому

    thanks for this Konze
    but
    when i write cd "python test"/
    its back with wrong or error
    there is any help with that

  • @programmingnothing
    @programmingnothing Рік тому

    I can't thank you enough.

  • @cybernono666666
    @cybernono666666 2 роки тому +1

    Thank you

  • @fatty-it-man
    @fatty-it-man Рік тому

    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)

  • @chenmoney1920
    @chenmoney1920 Рік тому

    what is the different between local and global directory ?

  • @vuthyyib2001
    @vuthyyib2001 2 роки тому +3

    Sir, How to fix this problem 'Unable to locate package python-openssl' ?

  • @kamilkashif4520
    @kamilkashif4520 2 роки тому +1

    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?

    • @k0nze_builds
      @k0nze_builds  2 роки тому

      It seems like you havn't added python and/or the pyenv/bin to your PATH variable.

  • @jakeislavic3024
    @jakeislavic3024 Рік тому

    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

  • @yuanruili9223
    @yuanruili9223 2 роки тому +1

    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!

    • @k0nze_builds
      @k0nze_builds  2 роки тому +1

      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

    • @yuanruili9223
      @yuanruili9223 2 роки тому

      @@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!

    • @k0nze_builds
      @k0nze_builds  2 роки тому

      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.

    • @yuanruili9223
      @yuanruili9223 2 роки тому

      @@k0nze_builds Thanks a lot! I will try this

  • @joshuaamaral52
    @joshuaamaral52 2 роки тому +2

    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?

    • @joshuaamaral52
      @joshuaamaral52 2 роки тому

      Using Ubuntu 21.04

    • @k0nze_builds
      @k0nze_builds  2 роки тому +3

      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.

    • @warsisarjeelrahman3940
      @warsisarjeelrahman3940 2 роки тому +7

      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

  • @tamkeensheikh9497
    @tamkeensheikh9497 5 місяців тому

    How to open Pycharm with command line.. please guide

  • @thorstenwidmer7275
    @thorstenwidmer7275 Рік тому

    got this error: Paket python-openssl kann nicht gefunden werden >>> can you help? regards

  • @aprakashdiy6048
    @aprakashdiy6048 8 місяців тому

    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?

  • @jobinnelson
    @jobinnelson 2 роки тому +1

    I'm getting an error in ubuntu 22 "E: Unable to locate package python-openssl"

    • @jobinnelson
      @jobinnelson 2 роки тому +2

      It worked when I tried python3-openssl

    • @k0nze_builds
      @k0nze_builds  2 роки тому +1

      Yes, you can fix most missing packages in Ubuntu by using the python3 variant instead of just python.

  • @vattikutirahul8160
    @vattikutirahul8160 2 роки тому

    When I tried,it got stuck at "Installing Python-3.8.3..." and there is no progress there after.What should I do?

  • @aletedini
    @aletedini Рік тому

    python dev ecosystem is such a mess. Thanks for this!

  • @geoffreykisuze1014
    @geoffreykisuze1014 2 роки тому

    I'd like to install and run odoo 13 using pyenv

    • @geoffreykisuze1014
      @geoffreykisuze1014 2 роки тому

      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?

    • @k0nze_builds
      @k0nze_builds  2 роки тому

      Unfortunately, I haven't worked with oodo yet. I replied to you on Twitter to try to solve your problem over there.

  • @barkingbandicoot
    @barkingbandicoot 9 місяців тому

    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?

  • @SiarheiAkhramenia
    @SiarheiAkhramenia Рік тому

    For every 'oo-buhn-too', 'u-buhn-too' and other kinds of '...buhn...'-people: 7fJF5UIS_hE

  • @jitesh.khuttan
    @jitesh.khuttan 2 роки тому +1

    Very helpful!

    • @k0nze_builds
      @k0nze_builds  2 роки тому

      I'm happy to hear that this video was helpful for you Jitesh!