I am trying to do a Physics problem in python. I need to install visual python because I get the error that it can't find the visual library when I type import visual from *

The documentation on the Visual Python site is totally useless.

I have gone into synaptic package manger and installed python-visual. But I still get the same error.

Can someone please help?

  • 1
    Installing falls more into the realm of superuser.com and serverfault.com, you might try your question there. (Even though it is programming-related.) – JYelton May 5 '10 at 22:36

You have to use

from visual import *

instead of

import visual from *

If that doesn't work please post the literal error messages you get when trying to do so and the output of running

apt-cache policy python-visual

in a Terminal window.

  • I have: from visual import * I just made a typo when asking the question. The output of the cmd you suggested is: glen@glen-laptop:~$ apt-cache policy python-visual python-visual: Installed: 1:5.12-1.1 Candidate: 1:5.12-1.1 Version table: *** 1:5.12-1.1 0 500 au.archive.ubuntu.com/ubuntu lucid/universe Packages 100 /var/lib/dpkg/status glen@glen-laptop:~$ Thanks, Glen. – Glen May 6 '10 at 0:03
  • That looks good. What error do you get if you start python from a Terminal and type "from visual import *"? – Florian Diesch May 6 '10 at 0:39
  • Hmmm... this is strange. It works when I run it in a cmd line. I can even draw a sphere. But when I run it from a file in IDLE I get the following error:Traceback (most recent call last): File "/home/glen/Documents/Phys1101/Planet Orbit Simulation.py", line 1, in <module> from visual import * ImportError: No module named visual I suspect I have multiple versions of python or something??? Perhaps I have the vpython installed for the wrong one? Any idea how I can point the one IDLE uses to the right vpython module? Thanks for your help so far! – Glen May 6 '10 at 4:18
  • Okay so I installed IDLE (using Python 2.6) and now it works. I had previously installed Python 2.6 on ubuntu 9.10 and then when I found there was a bug I upgraded to 10.04. I un installed Python 2.6 and installed Python 3.1. I would prefer if I could get things working with the newest version of Python. But it is working in the old version so it is not that important. Thanks for your help. I presume I need to set the Path variable for python to the right directory or make sure the python-visual package is in the python 3 folder. Although I am not sure how to do this. – Glen May 6 '10 at 6:32
apt-get install python-visual
  • 2
    That's doesn't change anything after installing python-visual from Synaptics like Glen did. – Florian Diesch May 5 '10 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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