![]() |
Anaconda / Spyder / VPython - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Anaconda / Spyder / VPython (/thread-10511.html) |
Anaconda / Spyder / VPython - mwatson87 - May-23-2018 Hi, Has anyone had experience installing the VPython module in Anaconda and running it within Spyder? My company laptop has Anaconda and Spyder pre-italled and so it would be great to get VPython working with it. Main reason is, I cannot freely download VPython myself without jumping hoops with my IT department. After downloading VPython in Anaconda I ran a basic script (for testing purposes) to display a sphere or a box... from vpython import * box()I got the following output in the console... runfile('C:/Users/WATS6441/.spyder-py3/sphere.py', wdir='C:/Users/WATS6441/.spyder-py3')And no window appears showing the box / sphere. I'd like to steer clear of downloading python then vpython and all the additional modules required as they all require admin IT input, but Anaconda lets me do it all through the navigator. Spyder doesn't kick up a fuss about Vpython not being found so I assume that is not the problem, but instead an issue with the rendering window. Has anyone has similar experience or recommend another module I can use that can model simple 3D projectiles like Vpython. Thanks for reading. Kind Regards, Martin RE: Anaconda / Spyder / VPython - snippsat - May-23-2018 Have you tried conda to install?Example: G:\Anaconda3\Scripts λ conda install -c vpython vpython Solving environment: done ## Package Plan ## environment location: G:\Anaconda3 added / updated specs: - vpython The following packages will be downloaded: package | build ---------------------------|----------------- certifi-2018.4.16 | py36_0 143 KB vpnotebook-0.1.3 | py36_1 10 KB vpython autobahn-18.3.1 | py_0 161 KB vpython vpython-7.4.4 | py36_0 3.8 MB vpython conda-4.5.4 | py36_0 1.0 MB txaio-2.9.0 | py_0 19 KB vpython ujson-1.35 | py36_0 23 KB ------------------------------------------------------------ Total: 5.1 MB The following NEW packages will be INSTALLED: autobahn: 18.3.1-py_0 vpython txaio: 2.9.0-py_0 vpython ujson: 1.35-py36_0 vpnotebook: 0.1.3-py36_1 vpython vpython: 7.4.4-py36_0 vpython The following packages will be UPDATED: certifi: 2018.1.18-py36_0 --> 2018.4.16-py36_0 conda: 4.5.0-py36_0 --> 4.5.4-py36_0 Proceed ([y]/n)? y Downloading and Extracting Packages certifi 2018.4.16: ################################################################################### | 100% vpnotebook 0.1.3: #################################################################################### | 100% autobahn 18.3.1: ##################################################################################### | 100% vpython 7.4.4: ####################################################################################### | 100% conda 4.5.4: ######################################################################################### | 100% txaio 2.9.0: ######################################################################################### | 100% ujson 1.35: ########################################################################################## | 100% Preparing transaction: done Verifying transaction: done Executing transaction: doneTest: G:\Anaconda3 λ python -m ptpython >>> from vpython import * >>> box(color=color.orange,material=color.white) <vpython.vpython.box object at 0x000001D33F4CF3C8>Look at my Anaconda tutorial. If admin also stop conda and pip ,i would build it at home with Miniconda - vpython,and used it from usb stick.
RE: Anaconda / Spyder / VPython - mwatson87 - May-24-2018 This is fantastic help! Thank you very much. With the amount of lunix distros I have on bootable USB devices I don't know why I didnt think about this approach. I will have a look over the next few days and let you know how I get on! UPDATE: When I type in the following into the python shell >>> from vpython import * >>> box(color=color.orange,material=color.white)I get <vpython.vpython.box object at 0x000001D33F4CF3C8>And a new iexplorer tab opens up, URL is 'http://localhost:65251/' with a black box in the tab, with no model of a box. I also tried sphere to be sure and same thing.... just a black box. Reverting back to Spyder and tring the same input as above the output is... runfile('C:/Users/WATS6441/.spyder-py3/sphere.py', wdir='C:/Users/WATS6441/.spyder-py3') <IPython.core.display.Javascript object> <IPython.core.display.Javascript object> <IPython.core.display.Javascript object> <IPython.core.display.Javascript object> <IPython.core.display.Javascript object> <IPython.core.display.Javascript object> <IPython.core.display.HTML object> <IPython.core.display.Javascript object>But this time no iexplorer tab opens up... Any ideas? RE: Anaconda / Spyder / VPython - snippsat - May-24-2018 How it work for me. As a scripts: # vs.py from vpython import * ball = sphere(pos=vector(0,10,0), radius=1, color=color.red) G:\Anaconda3 λ python vs.pyIt's open a tab in default browser(for me Chrome) at localhost:35438 and show a red ball. Inter active shell,i use ptpython. It open browser loacahost tab on import,then the same show the red ball on enter next line. G:\Anaconda3 λ python -m ptpython >>> from vpython import * >>> ball = sphere(pos=vector(0,10,0), radius=1, color=color.red) |