can use vpython on mac

100 views
Skip to first unread message

Scott Jin

unread,
May 7, 2017, 8:31:12 PM5/7/17
to VPython-users
Traceback (most recent call last):
  File "Untitled", line 3
    from vpython import *
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vpython/__init__.py", line 10
    from .vpython import *
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vpython/vpython.py", line 442
    get_ipython().kernel.comm_manager.register_target('glow', GlowWidget)
AttributeError: 'NoneType' object has no attribute 'kernel'


Traceback (most recent call last):
  File "Untitled", line 3
    from visual import *
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/visual.py", line 3
    print('This is ultran00b's package - visual')
                             ^
SyntaxError: invalid syntax


I can't use either visual package or vpython on my VIDLE 2.7 version.

plz help

Bruce Sherwood

unread,
May 7, 2017, 8:55:30 PM5/7/17
to VPython-users
See the detailed instructions on the first page of vpython.org. The problem is that the vpython module needs to run in a Jupyter notebook. As for the visual module, you have three single-quote marks in your string.

We are about to release a version of the vpython module that can run outside the Jupyter notebook environment, but only on Python 3.4 or later; because the necessary asynio websocket machinery that makes this possible is not available on Python 2.7.

Scott Jin

unread,
May 8, 2017, 6:12:12 PM5/8/17
to VPython-users
Hi Bruce, 
            Thanks for your reply. I actually looked into the file that shows the wrong case for the visual, the file is just one line .
I use pip2 install visual but why is the package only one line of code and how can i fix it? 

Sincerely,
Scott
Message has been deleted

Bruce Sherwood

unread,
May 8, 2017, 7:32:24 PM5/8/17
to VPython-users
There is no pip installer for Classic VPython (the visual module, VPython 6). If you want to install VPython 6, go to vpython.org and click on the appropriate download link at the upper left.

If you want to use the vpython module for Python 2 or 3, in the Jupyter notebook environment, see the detailed instructions on the first page of vpython.org.

If you want to use the pure browser version of VPython, GlowScript VPython, which requires no installation of software, see the details on the first page of vpython.org or go directly to glowscript.org.

Reply all
Reply to author
Forward
0 new messages