vpython / vpython-jupyter

3D visualization made easy
MIT License
141 stars 64 forks source link

How to use it in Google colab? #91

Closed okadath closed 4 years ago

okadath commented 4 years ago

Screenshot from 2020-04-11 21-10-22 hangs without render anything. I do the following steps to install the environment:

!apt install curl
!curl -sL https://deb.nodesource.com/setup_10.x | bash -
!apt-get install -y nodejs
!node -v
!pip install vpython
!jupyter labextension install vpython
BruceSherwood commented 4 years ago

What (if anything) do you see if instead of making a box you say print(version)? Are you working within an Anaconda environment, which is recommended? If you are in Anaconda, it is recommended to execute "conda install -c vpython vpython" rather than pip.

okadath commented 4 years ago

still not render :(

!wget -c https://repo.anaconda.com/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh
!chmod +x Miniconda3-4.5.4-Linux-x86_64.sh
!bash ./Miniconda3-4.5.4-Linux-x86_64.sh -b -f -p /usr/local
!yes | conda install -c vpython vpython
import sys
sys.path.append('/usr/local/lib/python3.6/site-packages')
!python -V
$Python 3.6.5 :: Anaconda, Inc.
import vpython 
vpython.__version__
$'7.6.1'
BruceSherwood commented 4 years ago

Okay, the next thing to test is to go to https://get.webgl.org. You should see a rotating box and a title "Your browser supports WebGL". (WebGL is the 3D graphics library built into modern browsers, which VPython uses to do the 3D rendering.) A closely related issue is that your graphics card must be capable of executing GPU code. What browser do you use?

okadath commented 4 years ago

Screenshot from 2020-04-14 14-07-30 in my pc runs perfectly, the problem is only in google colab

okadath commented 4 years ago

Screenshot from 2020-04-14 14-11-37 this is in my laptop, Mozilla Firefox, but in google colab not renderize yet :(

BruceSherwood commented 4 years ago

Sorry, I didn't read carefully enough to know that the problem occurs ONLY in Jupyter lab. I'll ask a colleague about this.

okadath commented 4 years ago

Thank you very much for answering

BruceSherwood commented 4 years ago

I apologize that although you kept saying "colab" I kept thinking "lab". While VPython does run in Jupyter lab, it does not (yet) run in colab, Our expert on Jupyter lab has looked into colab but has not found a way to make VPython work there.