vpython on Raspberry Pi 3 Model B

1,542 views
Skip to first unread message

ZebrasHaveTails

unread,
Aug 16, 2016, 10:58:09 PM8/16/16
to VPython-users
Hi everyone

 I was wondering if anyone has managed to install and get working  vpython on a Raspberry Pi 3 Model B. When I do:

sudo pip install vpython

I get the following error:

Python.h: No such file or directory
Compilation terminated

Thanks .. all advice welcome


Zebra

ps - I am a complete beginner at this.

Bruce Sherwood

unread,
Aug 17, 2016, 1:41:50 AM8/17/16
to VPython-users
I know nothing about Raspberry Pi, but for sudo pip install vpython to work you need to be able to install and run a Python distribution that includes the Jupyter notebook. The fact that there is no Python.h available implies that something is wrong with the Python installation, not with VPython.

Chris Jackson

unread,
Aug 17, 2016, 1:54:19 AM8/17/16
to vpytho...@googlegroups.com
Thanks  Bruce. It clearly does install on other platforms so this is a bit of a puzzle. If people are interested I could list the output in the Terminal Window about how the install goes.

On Wed, Aug 17, 2016 at 3:41 PM, Bruce Sherwood <bruce.s...@gmail.com> wrote:
I know nothing about Raspberry Pi, but for sudo pip install vpython to work you need to be able to install and run a Python distribution that includes the Jupyter notebook. The fact that there is no Python.h available implies that something is wrong with the Python installation, not with VPython.

--
You received this message because you are subscribed to a topic in the Google Groups "VPython-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vpython-users/7Bq6LNk7aKE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Scott Sumner

unread,
Aug 17, 2016, 2:33:48 AM8/17/16
to vpytho...@googlegroups.com
I have gotten vpython to work before on the Pi, here's what I did

run raspi-config from a terminal or SSH session on your Pi

go to the advanced options menu

go to GL driver

Choose Enable

Choose OK

It will prompt you to reboot, say Yes

This will enable the experimental graphics driver which allows you to get a decent framerate.  Otherwise graphics are not accelerated and you get less than 1 frame per second.

Once the Pi reboots do

sudo apt-get install python-visual

You probably won't have the IDE available but doing import vpython at the top of a script should then work when run with the regular python interpreter.

Scott


--
You received this message because you are subscribed to the Google Groups "VPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vpython-users+unsubscribe@googlegroups.com.

Chris Jackson

unread,
Aug 17, 2016, 2:40:27 AM8/17/16
to vpytho...@googlegroups.com
Thanks very much ... this is great advice. I will have a go and report back although it might take a little as I am going into evening now. I was aware that the new Raspberry supports the GL driver so I thought it should work. 


Scott Sumner

unread,
Aug 17, 2016, 2:43:53 AM8/17/16
to vpytho...@googlegroups.com
Indeed it does but since its experimental its not enabled by default, hence the raspi-config options

Scott

ZebrasHaveTails

unread,
Aug 17, 2016, 8:15:37 PM8/17/16
to VPython-users

Many thanks - this works really perfectly.

Proximity

unread,
Aug 23, 2016, 8:55:57 PM8/23/16
to VPython-users
Hi,
I've gotten vpython installed and have enabled the GL driver. If I try to run a simple program like:
    from visual import *
    sphere()
I don't get an error, but no window with the graphic opens.  Does anyone have any ideas as to what I missed?

Chris Jackson

unread,
Aug 23, 2016, 10:27:20 PM8/23/16
to vpytho...@googlegroups.com
hi there

It works for me on my raspberry 3 model b - do you have the same model? Earlier raspberry's do not have the GL Driver.

Cheers


--

Proximity

unread,
Aug 24, 2016, 7:16:58 AM8/24/16
to VPython-users
Thanks for the quick reply.  Yes, it's a raspberry 3 model b.  I'm accessing it using VNC - do you think that might be a factor?  I'm kind of a noobie, so the little knowledge I have is dwarfed by the tons I don't!
To unsubscribe from this group and all its topics, send an email to vpython-user...@googlegroups.com.

ZebrasHaveTails

unread,
Aug 26, 2016, 4:22:54 PM8/26/16
to VPython-users
Try the simplest arrangement of raspberry, keyboard, mouse and monitor - see if it works then?

Good luck!

Proximity

unread,
Aug 27, 2016, 11:40:13 AM8/27/16
to VPython-users
I might do that when I get a chance, but my intention with the Pi was to use it as a "headless" device.  I did load a fresh system on another micro SD card, but I got the same result.

Scott Sumner

unread,
Aug 27, 2016, 11:45:38 AM8/27/16
to vpytho...@googlegroups.com
The version of the Pi doesn't matter, its the version of Raspbian that you have to look at.  "Jesse" and above have the experimental driver.  Beyond that, when you are running headless (so I'm assuming connecting via SSH) you have to do

export DISPLAY=:0

from SSH first, otherwise it is trying to send the graphics to your text terminal.  The export command above will tell the Pi that its graphics output is the main Pi monitor.  If you get errors or it still doesn't work try starting with

sudo /bin/bash

which will make *everything* run as root, then try the export command followed by your vPython program.  While running as root is generally a bad idea I've found that its the fastest / easiest way to get around a lot of inherent permissions problems.

Scott


--
You received this message because you are subscribed to the Google Groups "VPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vpython-users+unsubscribe@googlegroups.com.

Chris Jackson

unread,
Aug 27, 2016, 7:09:09 PM8/27/16
to vpytho...@googlegroups.com
 I am using the raspberry as a remote device (is this the same as headless?) by using exagear (which I paid for)  and teamviewer. Fairly easy to install and use.

To unsubscribe from this group and all its topics, send an email to vpython-users+unsubscribe@googlegroups.com.

Proximity

unread,
Aug 27, 2016, 10:56:41 PM8/27/16
to VPython-users
Thank you both for your comments.  Exagear sounds like an interesting option.
I am just using SSH (PuTTy) to install the Tightvncserver software on the Pi, and once that's done, I use a VNC viewer to see the GUI on the Pi.  However, I just tried running Minecratt Pi Edition, and that doesn't work either, so maybe VNC is the problem.  When I get a chance, I'll investigate further.
To unsubscribe from this group and stop receiving emails from it, send an email to vpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Scott Sumner

unread,
Aug 27, 2016, 11:08:15 PM8/27/16
to vpytho...@googlegroups.com
Running headless is traditionally no monitor (sounds like that's what you're doing) or less accurately with only a monitor and no keyboard or mouse.  The interface is usually then only SSH.  The main advantage to running SSH is it uses a tiny amount of bandwidth as compared to a remote desktop solution such as VNC so its generally responsive immediately.  Heavy graphics applications often don't work over VNC, it depends on how they are generating their graphics "under the hood".

Scott


To unsubscribe from this group and stop receiving emails from it, send an email to vpython-users+unsubscribe@googlegroups.com.

Proximity

unread,
Aug 28, 2016, 2:14:51 PM8/28/16
to VPython-users
Scott,
Thanks for the info!  After a little research, I found this link:
http://serverfault.com/questions/174003/how-can-opengl-graphics-be-displayed-remotely-using-vnc
After removing tightvncserver, I installed x11vnc, and after a little playing around, it (mostly) works.  I still can't get Minecraft Pi Edition to start, but I really don't care about that.  However, I successfully get a VPython window to open when I create a visual python object.
To unsubscribe from this group and stop receiving emails from it, send an email to vpython-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages