10

I am trying to run this Python Program on Ubuntu but I am getting an error that says

ImportError: No module named visual

Can you guys please guide me on how can I resolve this issue?

Irfan Ghaffar7
  • 1,143
  • 4
  • 11
  • 30

3 Answers3

16

visual module has been renamed to vpython lately.

So to run this now, you first install vpython like:

sudo pip3 install vpython 

then replace the line:

from visual import *

with

from vpython import *

That worked for me.

bhaskarc
  • 9,269
  • 10
  • 65
  • 86
  • vpython requires Python 3.5 or later. Is there a way to get a version of the visual module that is backwards compatible with Python 2? – The Hagen Jan 16 '18 at 22:16
  • 3
    @TheHagen - older versions of vpython are available here http://vpython.org/contents/download/ – bhaskarc Jan 17 '18 at 13:18
5

The script requires Vpython to be installed.

Then, make sure it is actually installed. Alternatively, move the library into your local folder. If it still doesn't work, check for an __init__ file.

noɥʇʎԀʎzɐɹƆ
  • 9,967
  • 2
  • 50
  • 67
0

You can download a Python27 compatible version of vpython here (direct link).

To use vpython, you should run your code through VIDLE which should've also been installed. Through VIDLE, the syntax "visual" should be accepted. This worked for me.

  • That link is for a specific version and for windows only. see above for the http://vpython.org/contents/download/ link that does not have this restriction. – Wolfgang Fahl Jul 24 '19 at 04:35