4

I try to import vpython into anaconda. It seems to work so far, but if I call from visual import * it gives me an error.

However, it does work when I type from vpython import * ,which is really weird since in all programs I only see the from visual import * command.

Now to the real problem: I can't draw graphs. I have to call from visual.graph import * but this does not work (from vpython.graph import * doesn't work either).

I am receiving the error below:

ImportError Traceback (most recent call last) in () ----> 1 from visual import * ImportError: No module named visual

dirtydanee
  • 6,081
  • 2
  • 27
  • 43
Benutzername
  • 51
  • 1
  • 2

1 Answers1

0

The graph functions now live in the main vpython library when using Jupyter. So,

from vpython import *

should be sufficient. (P.S. I'd recommend not importing * but rather importing the functions you plan to use or just import vpython.)

Note however that some functions change name in the Jupyter-compatible version of VPython, so display becomes canvas and gdisplay becomes graph, and you have to explicitly use vector(x,y,z) rather than (x,y,z) and have to use obj.pos.x rather than obj.x

hsnee
  • 543
  • 2
  • 6
  • 17