Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Python working very slowly

I want to use visual for my project. I've used it many times before and everything was just fine, but I recently changed jobs so am using it on a machine that I've never worked on before

The problem is somewhat peculiar: when I run one of the example scripts from /visual/examples everything is just fine. However when I try to run a very simple script:

import visual
visual.sphere(pos=[0.,0.,0.],radius=1.,color=visual.color.red)

it takes a couple minutes to execute. This is completely unacceptable for the project I want to use it for.

I've tried running this sort of scripts from command line and IPython but the behaviour is the same: a visual window appears, Windows tags the window as "not responding" and then, after some painfully long time, the entire scene appears as expected.

This is clearly not a problem with what IDE I use to call visual and I'm seriously clueless about how to solve this. If that's of any importance I'm using a 64 bit Windows (also downloaded 64b visual) and a Python distribution that comes with Anaconda.

An interesting observation: The Python interpreter from which I run the script is not busy, i.e. I can execute other commands in it while the visual scene is not displaying correctly.

Any help or even ideas on what to do to try and resolve this issue would be very much appreciated.

like image 812
Aleksander Lidtke Avatar asked Nov 28 '13 12:11

Aleksander Lidtke


2 Answers

Do you have either a visual.sleep(pause_time) or visual.rate(frequency) line somewhere in your visualization loop? VPython requires one of these two lines to update the animation window.

like image 150
user1984653 Avatar answered Oct 04 '22 04:10

user1984653


I would start from scratch with a base python distribution/implementation.

Try downloading first a stock 64-bit Windows Python-2.7.5 : http://python.org/ftp/python/2.7.5/python-2.7.5.amd64.msi

Then download VPython-Win-64 : http://sourceforge.net/projects/vpythonwx/files/6.05-release/VPython-Win-64-Py2.7-6.05.exe/download

If this doesn't work, then it might be an issue with something other than vpython or anaconda.

If you can get it to work properly, then you can isolate the problem to either Anaconda's python implementation or the VPython module itself.

like image 35
William Denman Avatar answered Oct 04 '22 02:10

William Denman