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
@keremmor90692 жыл бұрын
This video was so helpful for my work.Thank you much Sam ! Appreciate it :)
@SamWestbyTech2 жыл бұрын
Thank you! Happy to help
@hiramkuykendall2 жыл бұрын
Nicely done! Greatly appreciate the instructions
@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 Жыл бұрын
Thanks! Very clear and concise
@jacobfredrickson98232 жыл бұрын
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?
@SamWestbyTech2 жыл бұрын
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
@eyaouerghemmi249511 ай бұрын
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.
@stlo030911 ай бұрын
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 Жыл бұрын
How to run a script in env on reboot...
@udaypolineni21812 жыл бұрын
does python 3.9.2 supports tensorflow
@dquin74132 жыл бұрын
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
@SamWestbyTech2 жыл бұрын
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
@SamWestbyTech2 жыл бұрын
In the thonny shell could you run python3 -V And pip freeze
@annastyabagasdewantara54892 жыл бұрын
Thank you very much, big love bro
@_RamjiG2 жыл бұрын
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?
@DaSmokeDaddy2 жыл бұрын
Would this work with Bullseye Debian on the Raspberry Pi?
@SamWestbyTech2 жыл бұрын
Yes it will!
@tariqnajjar65892 жыл бұрын
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?
@SamWestbyTech2 жыл бұрын
Depending on your device type “which python” in a terminal. This should be your base interpreter
@shreyasnelgikar71472 жыл бұрын
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?
@SamWestbyTech2 жыл бұрын
How long have you left it running? That part takes a while
@NaturallyGlowDIY2 жыл бұрын
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
@SamWestbyTech2 жыл бұрын
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.
@NaturallyGlowDIY2 жыл бұрын
@@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
@AnuragVarmaP2 жыл бұрын
same with me, python version didnt change. but i ran: eval "$(pyenv init -)" and after this it worked as required
@SamWestbyTech2 жыл бұрын
@@AnuragVarmaP Interesting. Did you also add eval "$(pyenv init -)" to the ~/.bashrc file and restart your terminal (Step 2 and 3)?
@miladgoudarzi7752 жыл бұрын
@@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.
@chekoser982 жыл бұрын
thanks for sharing!
@lilianamedina46532 жыл бұрын
Saludos 🇲🇽 good video
@jiminshii52992 жыл бұрын
Does python 3.9 support opencv
@SamWestbyTech2 жыл бұрын
yes it does!
@jiminshii52992 жыл бұрын
@@SamWestbyTechthank you. But in Google it's says that opencv is not supported in python 3.9 🥲
@voltieee2 жыл бұрын
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
@SamWestbyTech2 жыл бұрын
Good catch!
@marioashraf4262 жыл бұрын
thank you so much
@FM-rw6bs3 жыл бұрын
Thank you
@웅-e2e2 жыл бұрын
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)
@sunimaliattanayake30811 ай бұрын
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 -)"