ModuleNotFoundError: No module named 'vpython.with_notebook'

63 Views Asked by At

I'm trying to install vpython on visual studio code and executing it in a jupyter nootebook, but I get the error:

ModuleNotFoundError: No module named 'vpython.with_notebook'

from vpython import *
#from vpython import canvas,vector,sphere,cylinder,rate
from numpy import sqrt,array
from matplotlib.pyplot import plot,show

# constantes del problema

G=6.674e-11
M=1.989e30

# definimos la función de nuestro sistema de ecuaciones diferenciales

def f(r):
    x=r[0]
    y=r[1]
    vx=r[2]
    vy=r[3]
    
    r3=(x*x+y*y)**1.5

    fx=vx
    fy=vy
    fvx=-G*M*x/r3
    fvy=-G*M*y/r3
    
    return array([fx,fy,fvx,fvy],float)

# condiciones inciales

x0=4e12
y0=0
vx0=0
vy0=500

r=array([x0,y0,vx0,vy0],float)
scene=canvas(width=400,height=400,center=vector(x0/2,0,0))
scale=5e7
rs=1400
mc=10
sun=sphere(pos=vector(x0/30,0,0),radius=rs*scale,color=vector(255,250,0))
s=sphere(pos=vector(x0,y0,0),radius=50*mc*scale)
framerate=100

i=1
while i<len(xpp):       
    rate(framerate)
    s.pos=vector(xpp[i],ypp[i],0)
    i+=1
    scene=canvas(width=400,height=400,center=vector(x0/2,0,0))
    scale=5e7
    rs=1400
    mc=10
    sun=sphere(pos=vector(x0/30,0,0),radius=rs*scale,color=vector(255,250,0))
    s=sphere(pos=vector(x0,y0,0),radius=50*mc*scale)
    framerate=100
    
    i=1
    while i<len(xpp):       
        rate(framerate)
        s.pos=vector(xpp[i],ypp[i],0)
        i+=1

I have tried installing different versions of Jupyter Lab, Jupyter Notebook and Vpython and nothing happened. Why there is that many problems installing this package?

Thanks for reading

0

There are 0 best solutions below