Install Multiple Python Versions on Raspberry Pi

  Рет қаралды 20,874

Sam Westby Tech

Sam Westby Tech

Күн бұрын

Пікірлер: 42
@way-out350
@way-out350 2 жыл бұрын
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
@keremmor9069
@keremmor9069 2 жыл бұрын
This video was so helpful for my work.Thank you much Sam ! Appreciate it :)
@SamWestbyTech
@SamWestbyTech 2 жыл бұрын
Thank you! Happy to help
@hiramkuykendall
@hiramkuykendall 2 жыл бұрын
Nicely done! Greatly appreciate the instructions
@LifeofAryaElRumy
@LifeofAryaElRumy Жыл бұрын
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
@johncutler5995
@johncutler5995 Жыл бұрын
Thanks! Very clear and concise
@jacobfredrickson9823
@jacobfredrickson9823 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. kzbin.info/www/bejne/g5e5gIiJfMeYbJI
@eyaouerghemmi2495
@eyaouerghemmi2495 11 ай бұрын
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.
@stlo0309
@stlo0309 11 ай бұрын
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
@sarveshrodi33
@sarveshrodi33 Жыл бұрын
How to run a script in env on reboot...
@udaypolineni2181
@udaypolineni2181 2 жыл бұрын
does python 3.9.2 supports tensorflow
@dquin7413
@dquin7413 2 жыл бұрын
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
@annastyabagasdewantara5489
@annastyabagasdewantara5489 2 жыл бұрын
Thank you very much, big love bro
@_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?
@DaSmokeDaddy
@DaSmokeDaddy 2 жыл бұрын
Would this work with Bullseye Debian on the Raspberry Pi?
@SamWestbyTech
@SamWestbyTech 2 жыл бұрын
Yes it will!
@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 2 жыл бұрын
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
@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 жыл бұрын
@@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 жыл бұрын
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 жыл бұрын
@@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.
@chekoser98
@chekoser98 2 жыл бұрын
thanks for sharing!
@lilianamedina4653
@lilianamedina4653 2 жыл бұрын
Saludos 🇲🇽 good video
@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 🥲
@voltieee
@voltieee 2 жыл бұрын
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
@SamWestbyTech
@SamWestbyTech 2 жыл бұрын
Good catch!
@marioashraf426
@marioashraf426 2 жыл бұрын
thank you so much
@FM-rw6bs
@FM-rw6bs 3 жыл бұрын
Thank you
@웅-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)
@sunimaliattanayake308
@sunimaliattanayake308 11 ай бұрын
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 -)"
@MASTATANN
@MASTATANN 2 жыл бұрын
thanks, great job.
@Dr.AhmedQusaySabri
@Dr.AhmedQusaySabri Жыл бұрын
Thanks a lot
How to Install TensorFlow 2 and OpenCV on a Raspberry Pi
17:21
Sam Westby Tech
Рет қаралды 54 М.
This is how you destroy Raspberry Pi
9:10
Jeff Geerling
Рет қаралды 548 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
How to Install OpenCV on a Raspberry Pi
6:19
Sam Westby Tech
Рет қаралды 123 М.
DEEPSEEK Vs CHATGPT There Is A  Clear Winner !!
15:53
Rick Aqua
Рет қаралды 1,3 М.
I Made The Ultimate Cheating Device
9:39
ChromaLock
Рет қаралды 1,9 МЛН
Google Just Turned the RPi into a Supercomputer...
5:42
Data Slayer
Рет қаралды 580 М.
Raspberry Pi Servo Motor Control
17:36
ExplainingComputers
Рет қаралды 398 М.
How To Run TensorFlow Lite on Raspberry Pi for Object Detection
10:48
Edje Electronics
Рет қаралды 894 М.
I couldn’t do my job without this. - PiKVM
9:57
Linus Tech Tips
Рет қаралды 1,7 МЛН
Every Developer Needs a Raspberry Pi
27:27
Sam Meech-Ward
Рет қаралды 1,2 МЛН