Install Multiple Python Versions on Raspberry Pi

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ต.ค. 2024

ความคิดเห็น • 42

  • @way-out350
    @way-out350 2 ปีที่แล้ว +4

    I love you man, I legit just lost a whole day trying to get a virtual environment running for a specific python version. After so many methods and attempts, this was such a simple implementation. I can finally go to sleep

  • @eyaouerghemmi2495
    @eyaouerghemmi2495 7 หลายเดือนก่อน +1

    Thanks, great explanation ! I just can't change the version for my virtual environment. I followed the steps in the same venv folder but can't uninstall python 3.11 (it was installed by default) and i can't impose 3.8 that I need.
    Thank you for you time.

  • @johncutler5995
    @johncutler5995 ปีที่แล้ว

    Thanks! Very clear and concise

  • @LifeofAryaElRumy
    @LifeofAryaElRumy 9 หลายเดือนก่อน +1

    Hi sam!, great video, but i had a problem, how do i install library on the virtual environment? for example i want to install opencv in python 3.9.6 , i've try to 'sudo apt-get install python3-opencv' after i'm inside the virtual environtment, but it didn't work

  • @jacobfredrickson9823
    @jacobfredrickson9823 2 ปีที่แล้ว +2

    It seems using pyenv global doesn't apply to a virtualenv I have created. I've tried doing different things including the eval "$(pyenv init -)" command and saving it to the bashrc file, but the virtualenv always defaults back to 3.9 when activating it. I've also looked into using pyenv virtualenv, but that doesn't seem to work in my case. Is there a simple way to set the pyenv in the virtualenv and have it remain that way?

    • @SamWestbyTech
      @SamWestbyTech  2 ปีที่แล้ว

      You're going to have to remake your virtual environment. It's not too hard though. The reason why is because a virtual environment stores its own version of Python, so your virtual environment ignores the Python from pyenv and uses its own version. I have a video on virtual environments if you'd like to learn more. th-cam.com/video/MfVOUSGbe60/w-d-xo.html

  • @sunimaliattanayake308
    @sunimaliattanayake308 7 หลายเดือนก่อน

    why is this giving this error
    bash: /home/pi/.bashrc: line 125: syntax error: unexpected end of file
    when I save and exit the following command
    export PATH="$HOME/.pyenv/bin:$PATH"
    eval "$(pyenv init --path)"
    eval "$(pyenv virtualenv-init -)"

  • @stlo0309
    @stlo0309 7 หลายเดือนก่อน

    when installing the long list of system packages i get lots of errors saying `sudo apt fails to fetch ...` what can be the reason? infact because of these not getting installed, i am unable to use pyenv at all

  • @chekoser98
    @chekoser98 2 ปีที่แล้ว

    thanks for sharing!

  • @lilianamedina4653
    @lilianamedina4653 ปีที่แล้ว +1

    Saludos 🇲🇽 good video

  • @_RamjiG
    @_RamjiG 2 ปีที่แล้ว

    Hi. I need to use GPS module code in thonny which uses python 2.7.9, but my other module codes in thonny use 3.7.3 can you tell me a solution for this please?

  • @udaypolineni2181
    @udaypolineni2181 2 ปีที่แล้ว

    does python 3.9.2 supports tensorflow

  • @voltieee
    @voltieee ปีที่แล้ว

    On my end i got stuck installing python 3.11.1 on my zero and zero 2, the solution was increasing the swap space to about 512 MB or 1024 MB with the following command: sudo nano /etc/dphys-swapfile and then changing the 100 MB Line

  • @sarveshrodi33
    @sarveshrodi33 ปีที่แล้ว

    How to run a script in env on reboot...

  • @Dr.AhmedQusaySabri
    @Dr.AhmedQusaySabri 9 หลายเดือนก่อน

    Thanks a lot

  • @annastyabagasdewantara5489
    @annastyabagasdewantara5489 2 ปีที่แล้ว

    Thank you very much, big love bro

  • @tariqnajjar6589
    @tariqnajjar6589 2 ปีที่แล้ว

    hello
    i have watched your video about pyenv
    i installed python 3.6.5 on raspberry pi 4 and globaled it instead of 3.9
    while i am creating virtualenv on pycharm
    it is asking to choose base interpreter
    which file do i choose?

    • @SamWestbyTech
      @SamWestbyTech  ปีที่แล้ว

      Depending on your device type “which python” in a terminal. This should be your base interpreter

  • @shreyasnelgikar7147
    @shreyasnelgikar7147 2 ปีที่แล้ว

    Bro if I type pyenv install 3.7.12 it shows downloading few lines come and it freezes at line showing patching file config and doesn't move forward can you help me?

    • @SamWestbyTech
      @SamWestbyTech  2 ปีที่แล้ว

      How long have you left it running? That part takes a while

  • @dquin7413
    @dquin7413 2 ปีที่แล้ว +1

    Hello, I want to ask. The default python on my previous raspberry was 3.9, and I installed python globally 3.7 as in this video because there is a need. But when I want to run my python program through Thonny Python IDE and use python 3.7, all libraries are not listed (like picamera etc.), when I want to download the required library it says "library already exists", but can only be used when I use python 3.9 in Thonny IDE... How do I install/access those libraries in python 3.7?
    Thank You

    • @SamWestbyTech
      @SamWestbyTech  2 ปีที่แล้ว

      It looks like thonny comes with its own version of python 3.7. How do you install libraries? Thonny suggests you go Tools -> open system shell and install packages from that shell

    • @SamWestbyTech
      @SamWestbyTech  2 ปีที่แล้ว

      In the thonny shell could you run
      python3 -V
      And
      pip freeze

  • @DaSmokeDaddy
    @DaSmokeDaddy ปีที่แล้ว

    Would this work with Bullseye Debian on the Raspberry Pi?

  • @marioashraf426
    @marioashraf426 2 ปีที่แล้ว

    thank you so much

  • @hiramkuykendall
    @hiramkuykendall ปีที่แล้ว

    Nicely done! Greatly appreciate the instructions

  • @MASTATANN
    @MASTATANN 2 ปีที่แล้ว

    thanks, great job.

  • @FM-rw6bs
    @FM-rw6bs 2 ปีที่แล้ว

    Thank you

  • @keremmor9069
    @keremmor9069 2 ปีที่แล้ว

    This video was so helpful for my work.Thank you much Sam ! Appreciate it :)

  • @NaturallyGlowDIY
    @NaturallyGlowDIY 2 ปีที่แล้ว

    hi there thanx for you great tutoriel . i followed all the steps without any error but when i to switch to 3.7.12 i chekc the version of the python and it still the 3.9 !!
    pyenv local 3.7.12 dont give any error .. do you have any idea why .?? thanx

    • @SamWestbyTech
      @SamWestbyTech  2 ปีที่แล้ว

      If you run the command, pyenv local 3.7.12, and immediately check your python version, python -V, does it still show 3.9? My guess is you changed folders after running pyenv local 3.7.12. Pyenv local only changes the python version for the folder you're in.

    • @NaturallyGlowDIY
      @NaturallyGlowDIY 2 ปีที่แล้ว +1

      @@SamWestbyTech i'am still in the same folder i only check the version before and after the peyenv local and it shows the same version .. even pyenv global dont change anything

    • @AnuragVarmaP
      @AnuragVarmaP 2 ปีที่แล้ว +1

      same with me, python version didnt change.
      but i ran: eval "$(pyenv init -)"
      and after this it worked as required

    • @SamWestbyTech
      @SamWestbyTech  2 ปีที่แล้ว

      @@AnuragVarmaP Interesting. Did you also add eval "$(pyenv init -)" to the ~/.bashrc file and restart your terminal (Step 2 and 3)?

    • @miladgoudarzi775
      @miladgoudarzi775 2 ปีที่แล้ว +1

      @@NaturallyGlowDIY I don't know if the problem is solved or not, but I had the same issue and realized that when I run python3 --version, instead of python --version, I get my desired python version but with python --version I still get the default python version even after pyenv global command. So just try with python3 and I guess that's it.

  • @jiminshii5299
    @jiminshii5299 2 ปีที่แล้ว

    Does python 3.9 support opencv

    • @SamWestbyTech
      @SamWestbyTech  2 ปีที่แล้ว

      yes it does!

    • @jiminshii5299
      @jiminshii5299 2 ปีที่แล้ว

      @@SamWestbyTechthank you. But in Google it's says that opencv is not supported in python 3.9 🥲

  • @웅-e2e
    @웅-e2e 2 ปีที่แล้ว

    My rasbian OS python -V is 3.7.3 and I installed python3.9.2 through pyenv but when I try run openCV example code , I have a error like this
    Original error was: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by /home/pi/3.9.2/fall/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-arm-linux-gnueabihf.so)