6

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.

6
  • Have you tried using a non-anaconda Python? Which Python version are you using 2.7 or 3.3? Nov 28, 2013 at 12:48
  • @WilliamDenman look at the tags - 2.7. And yes, I have used non-Anaconda Python with visual many times with no problems. It's only now that I need to use it like this and when the problem starts appearing. Nov 28, 2013 at 13:31
  • Ah yes, sorry 'bout that, I didn't see that before. You mention that you recently changed jobs and are on a new computer. It is not clear in your question or last comment, but have you tried running a non-Anaconda Python and visual on the new computer? Nov 28, 2013 at 14:01
  • Sorry for making that unclear. And no, I haven't but I'd like to use it as it comes with a 64b Python and Spyder (my favourite IDE), which is normally for a 32b Python. There are some distributions like e.g. this one: code.google.com/p/winpython but I'd rather limit myself to distributions that I have used and know work fine. And Anaconda is one of them. Do you reckon using a different 64b Python distribution would make a difference? Nov 28, 2013 at 14:13
  • And I absolutely have to use a 64b Python due to memory limitations on Windows machines (and no, I cannot use a different OS as much as I'd like to). Nov 28, 2013 at 14:14

2 Answers 2

5

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.

2
  • Works like a dream. Not sure why I never really needed it before though, but doesn't matter so long as it gets the job done. Thanks a lot. Dec 2, 2013 at 17:55
  • I've also figured out it's a world of difference putting them at the start of the loop and the end of it. Get a visual.rate in as soon as possible basically. Jul 30, 2020 at 21:54
2

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.

2
  • Anaconda doesn't ship with VPython so I had to manually add it. Thanks man, I'll give it a shot (oh the joys of setting everything up anew...). But if this was something due to my Python distribution the examples from VPython should be affected too, which isn't the case. Nov 28, 2013 at 14:44
  • From my further readings and research, it looks like vpython is a beast (big distribution, long development). Meaning it might very well be a bug that you have found and it might be best to e-mail the vpython devs. Nov 28, 2013 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.