Vpython not working on windows with Python 3.5.2

351 views
Skip to first unread message

Lucas Jones

unread,
Aug 11, 2017, 11:10:31 AM8/11/17
to VPython-users
I installed vpython using the correct wheel, updated it, and attempted to run a test program (simple box).

Here is the error output:

Warning (from warnings module):
  File "C:\Python35\lib\site-packages\autobahn\websocket\protocol.py", line 627
    self._onMessage(payload, self.message_is_binary)
RuntimeWarning: coroutine 'WSserver.onMessage' was never awaited

Any ideas how to correct this error?

Bruce Sherwood

unread,
Aug 11, 2017, 11:14:33 AM8/11/17
to VPython-users
What platform (Windows, Mac, Linux)? What browser? With Jupyter notebook or without? The latest installer (7.1.2)? It's an unfamiliar error.

Bruce

Lucas Jones

unread,
Aug 11, 2017, 11:29:59 AM8/11/17
to VPython-users
Windows 7 using chrome.

Without Jupyter. I used the latest installer.

I don't mind doing a reinstall, but I've done it twice once using pip and once using the wheel and got the same error. If jupyter is better, I don't mind trying if someone can walk me through it.

Bruce Sherwood

unread,
Aug 11, 2017, 11:45:57 AM8/11/17
to VPython-users
I realize that I should also have asked how you start the box() program -- from IDLE? from a command prompt? other?

Also, have you started from a bare Python installation, or from Anaconda (the recommended distribution)?

Bruce

Lucas Jones

unread,
Aug 11, 2017, 11:53:54 AM8/11/17
to VPython-users
The first error I posted was from running it from idle.

If I try from cmd the attached is what I get (I apologize for the screen shot, I could not copy and paste)
vpythonerror.JPG

Lucas Jones

unread,
Aug 11, 2017, 11:54:53 AM8/11/17
to VPython-users
I was able to copy it.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Teacher>cd\python35\scrips
The system cannot find the path specified.

C:\Users\Teacher>cd\python35

C:\Python35>cd\python35\scripts

C:\Python35\Scripts>python3 vpythontest.py
'python3' is not recognized as an internal or external command,
operable program or batch file.

C:\Python35\Scripts>python vpythontest.py
Traceback (most recent call last):
  File "vpythontest.py", line 1, in <module>
    from vpython import *
  File "C:\Python35\lib\site-packages\vpython\__init__.py", line 37, in <module>

    from .no_notebook import *
  File "C:\Python35\lib\site-packages\vpython\no_notebook.py", line 1, in <modul
e>
    from .vpython import *
  File "C:\Python35\lib\site-packages\vpython\vpython.py", line 15, in <module>
    from numpy import arange
  File "C:\Python35\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import add_newdocs
  File "C:\Python35\lib\site-packages\numpy\add_newdocs.py", line 13, in <module
>
    from numpy.lib import add_newdoc
  File "C:\Python35\lib\site-packages\numpy\lib\__init__.py", line 8, in <module
>
    from .type_check import *
  File "C:\Python35\lib\site-packages\numpy\lib\type_check.py", line 11, in <mod
ule>
    import numpy.core.numeric as _nx
  File "C:\Python35\lib\site-packages\numpy\core\__init__.py", line 74, in <modu
le>
    from numpy.testing.nosetester import _numpy_tester
  File "C:\Python35\lib\site-packages\numpy\testing\__init__.py", line 10, in <m
odule>
    from unittest import TestCase
  File "C:\Python35\lib\unittest\__init__.py", line 64, in <module>
    from .main import TestProgram, main
  File "C:\Python35\lib\unittest\main.py", line 4, in <module>
    import argparse
  File "C:\Python35\lib\argparse.py", line 93, in <module>
    from gettext import gettext as _, ngettext
  File "C:\Python35\Scripts\gettext.py", line 13, in <module>
    print(getText('C:\\Users\\Teacher\\Documents\\Physical Science\\newparentlet
ter.docx'))
  File "C:\Python35\lib\encodings\cp437.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2019' in position
3657: character maps to <undefined>


Lucas Jones

unread,
Aug 11, 2017, 12:18:41 PM8/11/17
to VPython-users
I am installing Anaconda since it is recommended.


Bruce Sherwood

unread,
Aug 11, 2017, 1:08:56 PM8/11/17
to VPython-users
There is something VERY strange in the long error message. VPython executes "from numpy import arange", in order to make it easier to share the same program between true Python and the GlowScript environment where there is no difference between range and arange because JavaScript (to which Python compiles in the browser) doesn't distinguish between integer and float. The numpy import evidently checks something about numpy and wanders off into looking at some Word document of yours! It would seem that numpy is seriously mangled.

Let's hope that installing Anaconda gets rid of these problems.

Bruce

John

unread,
Aug 11, 2017, 1:40:01 PM8/11/17
to VPython-users
I think you need to use python version 3.5.3 or higher to use vpython. 

John

unread,
Aug 11, 2017, 1:48:06 PM8/11/17
to VPython-users
The documentation at vpython.org says

You can run from IDLE or Spyder with Python 3.5 (3.5.3 or greater) or 3.6

You didn't mention which of these you were using but since the error indicated that the error had to do with autobahn websocket then you need to be using at least python 3.5.3 and not python 3.5.2 .

Bruce Sherwood

unread,
Aug 11, 2017, 2:30:18 PM8/11/17
to VPython-users
Good point, John. Sorry I failed to spot that.

Bruce
Reply all
Reply to author
Forward
0 new messages