-4
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?

Sude Şahin
  • 11
  • 1
  • 4
  • This is saying that your code wasn't able to find the `base.vector` module. Usually this is a PATH/PYTHONPATH issue. What tutorial are you following and where is the `base` module installed? https://stackoverflow.com/questions/7850908/what-exactly-should-be-set-in-pythonpath for info on PYTHONPATH and how to set it – Kaia Aug 04 '21 at 19:31
  • 2
    What is `base`? Why do you think that it should have something called `vector`? – mkrieger1 Aug 04 '21 at 19:32
  • I don't know I take a lesson from a teacher so he did like that He used base but despite the fact that I just used import vector alone it gives same error – Sude Şahin Aug 04 '21 at 20:13
  • I installed pythonpath but it did not fix – Sude Şahin Aug 04 '21 at 20:14

1 Answers1

0

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.

VictorG-028
  • 16
  • 1
  • 3
  • I checked it is not a path issue also I reinstall the python in order to check if it is a path issue but there is a problem I tried to write pip install base in cmd it gives error – Sude Şahin Aug 05 '21 at 08:42
  • ERROR: Could not find a version that satisfies the requirement base (from versions: 1.0.0, 1.0.1, 1.0.4) ERROR: No matching distribution found for base (like this) it is a small version of error – Sude Şahin Aug 05 '21 at 08:42