Raspberry Pi LESSON 14: Installing Vpython (VIsual Python) on the Raspberry Pi

Поділитися
Вставка
  • Опубліковано 21 жов 2024

КОМЕНТАРІ • 114

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

    UPDATE JUNE 8, 2023 - Some of you might be having trouble installing vpython according to the instructions in this video. This is due to OS update which causes broken dependencies. If you are having difficulty, try the following steps to install vpython. As of June 8, 2023, these steps work for Buster OS.
    Flash fresh Buster Legacy OS
    curl sh.rustup.rs -sSf | sh
    sudo apt install libssl-dev
    sudo apt update
    sudo apt upgrade
    sudo apt install chromium-browser -y
    sudo reboot
    pip3 install vpython
    sudo apt remove python3-pip
    wget bootstrap.pypa.io/get-pip.py
    sudo python3 get-pip.py
    pip uninstall cryptography
    pip install --upgrade cryptography==36.0.2
    sudo apt-get install thonny
    I am hoping this works for you.

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

      EDIT: These instructions do in fact work on a fresh flash of Bullseye and the performance is indistinguishable between Bullseye and Buster as far as I can tell, whether VNC'd or working direct. Thanks again!
      Thank you so much! Just as a heads up for others who find themselves needing to do this, it worked for me on a pretty much new flash of Bullseye. Although manipulating the object in the browser is a bit slow compared to Paul's. It could also be because I am VNC'd into my Pi so I will try a new flash of Buster and will update this comment on performance.

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

      Paul, I love your video's and have followed everyone so far, but your latest solution for installing vpython on the raspberry Pi4 is quite complicated. Any chance of a short video for latest update Peter NZ

    • @DavidConner-yz2ud
      @DavidConner-yz2ud Рік тому

      Retired engineer here really ejoying your lessons - that is until now! This is all very new to me so I ask a dumb question. Is the first line above a command or are you titling the process because my Raspberry Pi says it can't find a Flash command. I did proceed with the rest of this process but it did not fix my problem installing vpython - it says it can't find the RUST Compiler.

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

      This fixed my issue, thank you!

    • @BunnLilah
      @BunnLilah 2 місяці тому

      @@DavidConner-yz2ud Hello! This is a year late but I believe the first line is instructing you to flash your Pi with a fresh Buster Legacy OS, so you'd have to go back to that initial setup and do that part again but with Buster Legacy OS instead. Then I think you do the rest on the newly flashed OS.

  • @stephenlightkep1621
    @stephenlightkep1621 Рік тому +3

    As you warned us about not using buster I have failed. My raspberry pi is too new for buster, so I see some sort of fix is available in the comments. I will revisit this another time! Thanks for all your great lessons

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

    I've made 3 videos just in case anyone is interested in my pico programs.
    Very Basic Color Picker - ua-cam.com/video/sx_ujgPV_Y8/v-deo.html
    Lesson 11 - ua-cam.com/video/OaSbNY8M4bg/v-deo.html
    Lesson 12 - ua-cam.com/video/ceOfyfgoHio/v-deo.html

  • @xaviercasanova2938
    @xaviercasanova2938 Рік тому +3

    As for 26/June/2023 running RPi OS Bullseye 64bit with python 3.9.2, this solved the issue for me:
    Following the video, I ran :
    >> pip3 install vpython
    The instalation was succesfull, then I ran in python:
    >> from vpython import *
    >> ball = sphere(radius=2, color=color.red)
    Here I got the problem with "AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'", and solved the issue by:
    >> quit()
    >> sudo pip install pip --upgrade
    >> sudo pip install pyopenssl --upgrade
    Then followed the video and everything worked!

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

      Yes, this worked for me. Thank you

    • @Karlsefni-tu4zf
      @Karlsefni-tu4zf 10 місяців тому

      This should be pinned, completely fixed my problem as of December 16, 2023. Can now do the lesson. thank you!

    • @JaneRivers-u5s
      @JaneRivers-u5s 4 місяці тому +2

      To anyone in the future who has a blank screen open in chromium which never loads. What's happening is that WebGL 2 is not enabled. Go to chromium settings and disable "Use graphics acceleration when available". This fixed my issue at the time of June 2024. I am on a raspberry pi 3, so this might not be an issue on higher models

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

    Paul - great tutorial series, i love each and everyone.

  • @aman-sood
    @aman-sood 2 роки тому

    Homework done, I'm back catching up! I won't miss that raspberry pi mid-term exam for anything in the world.

  • @mitulshobbies6868
    @mitulshobbies6868 2 місяці тому

    Did anybody else notice the ant on the Breadboard? You can see the little fella at about 21 minutes. I have decided to call him(?) Eggbert! All hail Eggbert. Also thank you Paul for these great videos!

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

    Paul, Thanks for another great video. I found vPython great for learning more about Python and 3d rendering. It makes a great simulation tool. I am glad your videos cover it so well but I do find it falls short as a user interface. Thanks again and looking forward to what comes next.

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

      Yes, Vpython is a rather small group of guys maintaining the library. Exceptional work they have done to bring us this 3D capability, but do with it was a more fully developed library.

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

    Paul: Please start the nano editor with the option -l f.e. nano -l
    Tnx for your nice lessons.

  • @aman-sood
    @aman-sood 2 роки тому

    Real cool lesson, my virtual led model coming soon!

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

    Paul, amaaagggiiing video thanks, got a bit of a problem at first, but got it later, btw, will there be any raspberry pico series??

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

    Your efforts are appreciated.

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

    I'm on RPi OS Bullseye with Python 3.9.2, installing VPython was quite painful, I got this error "AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'", quick search on Internet says that upgrading pip "pip install --upgrade pip" and installing/updating pyOpenSSL "pip install --upgrade pyOpenSSL" will fix that error, but that did not work for me, because VPython installation somehow trashed my pip command... Turns out that running previous pip upgrade command with sudo fixed my pip installation and then was able to run second command (without sudo) to upgrade pyOpenSSL and voilà!, now I can run VPython on my RPi. Thanks for this lessons, Paul. Editing comment to add that processor gets very hot when running VPython, even with heatsink and 5v fan, RPi goes from (regular) 48º Celsius to 72º or more and has restarted few times on its own, I think it need a better cooling system, since is also overclocked to 2 Ghz.

    • @paulmcwhorter
      @paulmcwhorter  Рік тому +2

      Freddy, just confirmed your solution for Bullseye 64 bit. Solution for Buster is above in description but for Bullseye:
      pip install vpython
      sudo pip install --upgrade pip
      pip install --upgrade pyopenssl
      then things work.

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

      As for 26/June/2023 running RPi OS Bullseye 64bit with python 3.9.2, this solved the issue for me:
      Following the video, I ran :
      >> pip3 install vpython
      The instalation was succesfull, then I ran in python:
      >> from vpython import *
      >> ball = sphere(radius=2, color=color.red)
      Here I got the problem with "AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'", and solved the issue by:
      >> quit()
      >> sudo pip install pip --upgrade
      >> sudo pip install pyopenssl --upgrade
      Then followed the video and everything worked!

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

    Of course this was another great lesson! Thank you Paul!

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

    sorry, I skipped it yet did create a object array of the RGB and had it randomly change colors. I did learn a lot of needed information by doing so and have a very cool looking RGB LED slowly changing colors. :) Even got myself singing: Python can do Object arrays! :) Not sure if you covered this, but to get the best results from the RGB make sure that you set each color to a max of 33 so you will not get to much bleeding of colors as you more or less have 300% if you have all 3 colors maxed.

  • @ericsandels3015
    @ericsandels3015 Рік тому +3

    Hi Paul, I know I am a little late, but my vpython installation does not work. At first, I got the error message: "Failed to build wheel for cryptography". After a few tries the installation just stops at "building wheels for cryptography", and the CPU gets really hot, even with the heat sink (about 70 Celsius). I tried everything I could find online, but I can't get past that stage. Any ideas? (P.S. really enjoying the series so far!)

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

      Are you on the buster operating system? That is what I was on for this lesson. I have not tried it on the more recent bullseye operating system.

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

      I am on the bullseye operating system. Maybe that’s the problem. Is it possible to switch to buster?

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

      Aargh, not quite there yet. 'from vpython import *' now works in python3, but when I try to create a box or sphere I get a couple of screenfuls of stack trace. Something about module 'lib' has no attribute 'X509_V_FLAG_CB.....

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

      You flash a fresh card. You select a legacy operating system, and install the Buster.

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

      @@paulmcwhorter​ Does that mean all my data on my original raspberry pi will be lost? In Lesson 1 didn’t you install Debian (Bullseye) OS?

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

    Unfortunately I can't get this to work. I installed the Buster OS as instructed and followed the other instructions as well. But when I try to create an object in Vpython from the Python shell, nothing happens. The shell hangs and no browser window is opened. I tried both Chromium and Firefox as default browser. I installed the 32-bit version of Buster OS, should I try the 64-bit version?

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

    Hi All, need your help! I have installed buster OS on RPi 3, the python version is 3.7, exactly as Poul has. After importing of vpython I try tobuild a sphere and have the following error:
    module 'lib' has no attribute'X509_V_FLAG_CB_ISSUER_CHECK'

  • @cobotteamllc3844
    @cobotteamllc3844 5 днів тому +1

    Solution right here:
    ua-cam.com/video/fjpScYRPFvE/v-deo.html
    I was fighting non stop with the terminal and for some reason the terminal is actually not working with VPYTHON. But when I checked in Thonny, vpython was already installed and just ended up coding there.

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

    Hello Sir,
    good morning,
    I'm from India, i use to watch your videos, and since now I'm really very impressed, nd being encouraged by ur videos.. thanks a lot, Keep helping us such the way u r expert in...
    and i want to have your contact information, so that i also can share, something, very important topics,.. i have a great revolutionary innovating Idea on Robotics, nd human feelings transfering to a robot.. so I'll be waiting for your response.. thanks again.. have a great day

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

    i'm having the same problems re rust compiler and failing to build for cartography, i have buster ver 10 installed . is there any one in Sydney Australia online who can help, i live in Orange nsw

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

    Hello Paul, I have a raspberry pi 3, and I saw that you said it should work for a buster operating system, so I installed it from the raspberry pi site and loaded it on my pi, but still, nothing showing up from vpython, what should I do? Thanks.

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

    Please do more lessons using the Oscilloscope

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

    Good basic example using visual python. However, the virtual led is shown being passively illuminated from an external source rather than being self illuminated.
    Is there a way to self illuminate an object in visual python?

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

      THat is not something you can do. In my earlier series I tried to simulate it by putting a sphere in the middle of the upper part of the LED, and always illuminating it brighter than the outer case, and then made both somewhat translucent.

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

    Fantastic Lesson!!!!!

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

    Here is my version of OCD+,ua-cam.com/video/80uTeXUQ9iU/v-deo.html , Not as creative as Charlotte in trying to get the led to display correctly with the camera I reverted to the ping pong ball. Apologizes for the shaky video at the beginning still trying to figure out how to get the pi to take video and could only get one camera at a time to work on Windows.

  • @WilliamLundy-e5t
    @WilliamLundy-e5t 7 місяців тому

    Paul, I purchased my Pi in January of this year (2024) and I cannot get the vpython to work and when I try to install it I get more warning than a 747 in full engine failure fire!! Don't want to fry my Pi so skipped trying to load it and do the home work.

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

    And will there be more lessons using Vpython? Otherwise I can get this working on my Mac (sort of, without using GPIO's) and continue on the Pi with the other lessons ...

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

      Several lessons use vpython, then we move on.

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

    Hi Paul, I've been taking this course for the past two weeks or so, unfortunately I was unable to get vpython working on my Raspberry Pi 4b on Python 3.11. I tried many different things suggested on the internet but none of them worked, I am just going to skip this lesson.

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

    This is a fantastic series.!!
    HOWEVER, I have a question for the group.
    Has anyone been able to replicate the installation of VPYTHON?!? I did get it working about the time that Paul released this lesson, but after working the homework for a couple of the VPYTHON episodes, I did an accidental upgrade and then NOTHING WORKS
    🙁☹😦
    If anyone has been able to get this working on their Raspberry Pi 4 I am asking that they PLEASE create an in depth reply that explains WHICH Buster OS they installed (version / date of Buster), and then provide step by step instructions so the installation of VPYTHON will work. I have tried everything I can think of and still can not seem to get the installation to run without fatal errors. Typically failure notices have to do with Cryptography failing, or not finding a RUST compiler, etc.
    Thanks In Advance!

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

      Some OS updates broke vpython dependencies. Try this on Buster OS
      Flash fresh Buster Legacy OS
      curl sh.rustup.rs -sSf | sh
      sudo apt install libssl-dev
      sudo apt update
      sudo apt upgrade
      sudo apt install chromium-browser -y
      sudo reboot
      pip3 install vpython
      sudo apt remove python3-pip
      wget bootstrap.pypa.io/get-pip.py
      sudo python3 get-pip.py
      pip uninstall cryptography
      pip install --upgrade cryptography==36.0.2
      sudo apt-get install thonny

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

      @@paulmcwhorter THANK YOU for these instructions.
      I found that i could not import vpython into python3 until I did a final reinstall using: sudo pip3 install vypthon. However, once i did this vpython is now working!

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

    Could not get visual python installed

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

    I downloaded raspberry pi lesson 1 (First boot and configuring) I was supposed to get Python 3.7 and buster installed on my Pi but I got Python 3.9.2 . Some parts work but in Lesson 14 create virtual LED using vpython and buster operating system does not work. Any suggestions?

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

      I'm now on rpLesson 45, the PiCamera. All's well there, downloaded Bullseye 64-bit. Will try this new system, or return to Buster 32 bit when I get to it.

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

    @paulmcwhorter ... --- ... S-O-S, Paul : BUSTER? this is the 1st time I hear the name ( in the context of these lessons ) .. my install of vphython errors out.. like some of the comments I read below.. I have followed your lessons from OPENING THE BOX containing the RPi4.. and flashing the mem card .. I am STUCK... not sure how to proceed.. what happens if I SKIP over this lesson? is vpython necessary for future lessons ?

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

      David, for this set of lessons we are using the Buster operating system. They have now migrated to Bullseye. If you are inadvertantly operating on Bullseye you might have issues. Go back and flash a fresh SD card on Buster, and see if it works.

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

      @@paulmcwhorter Paul... thanks for responding... I will look to doing as you have recommended... . I DID follow what you taught in Lesson 14.. very cool .. to see hardware duplicated in software .. for the moment though, I am going to press on with the Lesson Plan ... and work to get the Buster Operating System installed ( in the background, so to speak ) .. thanks again for these lessons and for responding to my 'SOS'... Blessings to you...

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

    Paul, did you notice that the exception routine is not putting out message? this problem shows up on your video and my pi 3.

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

      Did not notice that.

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

      @@paulmcwhorter If you find an answer you will put where others can profit. Just arrived today a pi 4b8g hope to set it up tomorrow!

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

    Since vpython renders in the browser, running on the Pi, how could you make this work if you're running headless, using SSH from another computer?

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

      You need to run a remote desktop using vnc. I will show that in later lessons.

  • @HUDSON-EV
    @HUDSON-EV 2 роки тому

    Thanks Paul

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

    Beautiful!! 🤩🥰💪💪💪

  • @tntragan
    @tntragan Рік тому +4

    I had the same issue as some of the other viewers did with downloading vpython. Finally got it working after a couple days of tinkering. Got my homework done successfully. Completely new to publishing anything on youtube but hopefully I was successful at that part of it. Couldn't figure out how to do a screen capture of the video so I shot it with my phone. I also haven't been able to figure out how to edit the video now that I made it. Oh well, you get the idea. Might want to mute it as I didn't add any cool music. Just my wife making noise in the background.
    ua-cam.com/video/Tbp1gRcHJws/v-deo.html

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

      How did you get vpython working? i have been trying different things for the last week with no success. Many thanks.

    • @ronforbes6798
      @ronforbes6798 Рік тому +2

      I would also like to know how you got it working , im having trouble with the rust compiler

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

      Hi
      I also need to know how did you got vpython working?
      Gets the same error several times: "Failed building wheel for cryptography"

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

      I am also getting the failed building wheel for cryptography. after following instructions. and updating PIP

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

      @@WACkZerdenWereyou ever able to find a fix for this?

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

    vpython is not working on my Pi it installed but will not run wondering if it is because this class is old

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

      If you do exactly what I am doing it should work.

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

      I did everything you said in your video but still will not install all the way.
      AttributeError: module ‘lib’ has no attribute ‘x509_v_FLAG_CB_ISSUER_CHECK’

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

      Sadly, installing Buster and ensuring I have installed pip3 (it doesn’t come native on the last Buster build) still won’t correctly install vpython. Very discouraging.

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

      Daniel I'm having the same problem. tried the above solutions but not helping. Any advice? @@danielwinegardner6909

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

    Did anyone get results with a Pi 3? Mine gave an error when trying to bring up the virtual image of the ball or box.

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

      THis really should work on the pi 3 if you are using the Buster operating system

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

      @@paulmcwhorter I also could not get vpython to work on a pi 3. I dont think that it has the processing abilities to do do the graphics rendering.

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

      Yeah when I pip3 install I had several yellow warnings but it looked like it installed. I ran a simple sphere code it switched to the browser but never rendered. I never got error messages. I am running on pi 3 with Buster 10.11.

  • @cobotteamllc3844
    @cobotteamllc3844 19 днів тому

    On the newest solution, everything goes well until: pip3 install vpython
    I get the error:
    E:Unable to locate package python3-vpython
    Anyone with the same issue?
    I have pip 23.0.1 (python 3.11)

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

    Well we don't need such a evolved language than python, all i want to do for example is sending data from a server to another. The most important thing is that scripting language, JavaScript

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

    That was meee.

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

    Hi Paul. I followed your revised method to install vpython on a fresh Buster OS and had many errors [rust and cryptography mainly]. However I did find a method that worked using Thonny to import vpython via the tools menu. Instructions can be found here ua-cam.com/video/fjpScYRPFvE/v-deo.htmlsi=VH_L1RHq-6RBP9HS

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

    Hi all!
    Just did my homework: ua-cam.com/video/AFnN9OD5t6Q/v-deo.html
    Python runs not so smooth on the Raspberry Pi. I had some annoying exceptions.
    Maybe it was my fault. I'm a beginner with Vpython.

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

      Absolutely amazing level of detail. Excellent!