ImportError: No module named visual

佐手、 提交于 2019-12-10 03:49:00

问题


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?


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/28592211/importerror-no-module-named-visual

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!