VPython 7 works

605 views
Skip to first unread message

Bruce Sherwood

unread,
May 18, 2017, 11:32:55 AM5/18/17
to VPython-users
There is now a vpython module, to be called VPython 7, that detects whether you're using a Jupyter notebook or not and runs all the standard demos either way. You can run your Python program in any way you like, including from IDLE or from a command line. When not using a Jupyter notebook, the vpython module starts up a window in a browser and displays there, but print output goes to the IDLE shell window or to the command line area. The function GSprint, which is also available in GlowScript VPython, displays output below the VPython caption (GSprint mostly doesn't work in the notebook.) 

Currently, if you edit your program in IDLE and run it again from IDLE, the display will be in an additional browser tab. It's not clear exactly how this should work. One interesting feature of the current behavior is that you can compare the graphical output from two runs.

If you'd like to try this before Matt Craig is able to create installers, first you need to "pip install vpython" if you don't already have it installend and then you need to replace in site-packages/vpython these files:

vpython.py 
The folder vpython_libraries


I'm again very grateful to John Coady for several crucial suggestions that made the new capability possible.

Bruce Sherwood

unread,
May 18, 2017, 3:46:47 PM5/18/17
to VPython-users
I forgot to say that the new non-notebook vpython module does not work with Python 2.7, as it requires some modules not available in Python 2. The notebook version will however continue to work with Python 2.7.

Samuel Teixeira Santos

unread,
May 18, 2017, 3:51:11 PM5/18/17
to vpytho...@googlegroups.com
Hi Bruce!

Just to be clear, I install vpython by pip normally Python 3.5(minimum)?

and then I overwrite 
vpython.py 
and vpython folder in site-packages from files in vpython_libraries folder?

both new files are from the github link you pass.

is that correct?

Thanks in advance.

Samuel

2017-05-18 16:46 GMT-03:00 Bruce Sherwood <bruce.s...@gmail.com>:
I forgot to say that the new non-notebook vpython module does not work with Python 2.7, as it requires some modules not available in Python 2. The notebook version will however continue to work with Python 2.7.

--
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.
For more options, visit https://groups.google.com/d/optout.



--
Falou!

Samuel Teixeira Santos
サントスサムエル テイェイラ


P
ost Scriptum:

Por favor, ao encaminhar as mensagens "globais"(não direcionadas somente a minha pessoa):
1. Apague o meu e-mail e o meu nome no corpo da mensagem.
2. Apague também qualquer endereço de e-mail e nome que esteja no corpo da mensagem
3. Inclua seus destinatários apenas na opção de cópia oculta (Cco ou Bcc).

Agindo assim podemos dificultar a disseminação de vírus, spams e banner.
Acho que vale a pena tentar.

Bruce Sherwood

unread,
May 18, 2017, 4:22:14 PM5/18/17
to VPython-users
You need to do this:

1) Overwrite the file named vpython.py with the file vpython.py found at GitHub.

2) Overwrite the folder named vpython_libraries with the folder vpython_libraries found at GitHub.

Bruce Sherwood

unread,
May 18, 2017, 4:41:18 PM5/18/17
to VPython-users
I forgot one other important instruction. You need to do "pip install autobahn". This will be taken care of automatically by the installers that Matt Craig is building.

Bruce Sherwood

unread,
May 18, 2017, 5:06:07 PM5/18/17
to VPython-users
I was still wrong in my instructions. Though I don't understand why, the thing to do (which is also the simplest to describe) is to replace the entire vpython folder with the vpython folder found at 


And also do "pip install autobahn".

Again, note that autobahn is not available for Python 2.7.

Sorry for the confusion.

Bruce Sherwood

unread,
May 18, 2017, 5:41:54 PM5/18/17
to VPython-users
It all works on my two Windows machines running Python 3.6 but not on a colleague's Windows machine running Python 3.5. Will investigate further.

Bruce Sherwood

unread,
May 18, 2017, 9:37:08 PM5/18/17
to VPython-users
I created "virtual environments" in Windows 10 Anaconda and was able to run VPython both with and without a notebook on Python 3.5, but not without a notebook on Python 3.4, which gives an error in the "asyncio/autobahn" area in which Python 3.4 differs somewhat from Python 3.5 and 3.6.

Samuel Teixeira Santos

unread,
May 19, 2017, 8:11:40 PM5/19/17
to vpytho...@googlegroups.com
Hi Bruce,


I'm using Kubuntu LTS 16.04 in a Asus X555L and I follow your instructions on python 3.6.1 virtualenv and works perfectly.

Thanks.


--

Bruce Sherwood

unread,
May 19, 2017, 9:05:19 PM5/19/17
to VPython-users
Thanks for the good news!

Muhammad Noman Hameed

unread,
Apr 28, 2019, 5:10:46 PM4/28/19
to VPython-users


On Thursday, May 18, 2017 at 8:32:55 PM UTC+5, Bruce Sherwood wrote:
There is now a vpython module, to be called VPython 7, that detects whether you're using a Jupyter notebook or not and runs all the standard demos either way. You can run your Python program in any way you like, including from IDLE or from a command line. When not using a Jupyter notebook, the vpython module starts up a window in a browser and displays there, but print output goes to the IDLE shell window or to the command line area. The function GSprint, which is also available in GlowScript VPython, displays output below the VPython caption (GSprint mostly doesn't work in the notebook.) ..........
###############################
I have done same procedure, of copy the whole folder in place. but...
It is not woking yet in my case,  a runtime error occurs in my spyder 3.3.4...
""
  File "C:\Users\Noman\Anaconda3\lib\site-packages\vpython\__init__.py", line 42, in <module>
    del gsprint,vpython

NameError: name 'gsprint' is not defined""""

It is only working in jupyter correctly, but not in spyder, please help me out.

bruce.s...@gmail.com

unread,
Apr 28, 2019, 6:41:46 PM4/28/19
to VPython-users
Are you using VPython 7.5.0? It addressed many issues, including these issues. See the detailed installatoin instructions at vpython.org.

Bruce
Reply all
Reply to author
Forward
0 new messages