Skip to content
Advertisement

I wrote a code in python a animation code but it gives modulenotfounderror . No module named vector . Could you explain it’s reason. please [closed]

from random import *
from turtle import*

from base import vector
ant=vector(0,0)
aim=vector(2,0)
def wrap(value):
    return value
def draw():
    ant.move(aim)
    ant.x=wrap(ant.x)
    ant.y=wrap(ant.y)
    aim.move(random()-30)
    aim.rotate(random()*10-50)
    clear()
    goto(ant.x,ant.y)
    dot(4)
    if running:
        ontimer(draw,100)
setup(470,470,370,0)
hideturtle()
tracer(False)
up()
running=True
draw()
done()

I am new in game programming. I tried to create a animation with coding in python but İt gives modulenotfounderror. No module named vector. Could you explain?

Advertisement

Answer

If this is a path issue, then you need to check if an environment variable with the path to python libraries exists in your machine. This environment variable is automatically created during the installation of python if you have checked a box that says “Add python to Path”.

If you have checked the box, then you just need to do pip install base (or what the documentation of Base module says) in your terminal to install this module and, after installing, you can start using it in your python scripts. If you haven’t checked the box, then you can open the python installer again and do so.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement