Marcos Brinner
Marcos Brinner

Reputation: 207

Python - ImportError: No module named 'vector'

I'm getting this error:

Traceback (most recent call last):
File "C:\Users\marcos_brinner\Desktop\jogo.py", line 11, in <module>
from vector import *
ImportError: No module named 'vector'

I can't find the vector module online.

Code is as follows:

try:
    import sys
    import random
    import math
    import os
    import getopt
    import pygame
    import pickle
    import copy
    from collections import *
    from socket import *
    from pygame.locals import *
    from vector import *
    import yaml
    import pygame.mixer
    import ConfigParser

except ImportError, err:
    print "couldn't load module. %s" % (err)
    sys.exit(2)

Upvotes: 1

Views: 7505

Answers (1)

s0nskar
s0nskar

Reputation: 128

Read the description given below the video (https://www.youtube.com/watch?v=aUCyfdzP-i8). It is clearly written "I've also used this module for 2d vectors: (change "vec2d" to "vector") http://www.pygame.org/wiki/2DVectorClass" .so copy the code from link and save it into the same folder as jogo.py i.e in your case "C:\Users\marcos_brinner\Desktop\vector.py". PS: do not forget to rename your class vec2d to class vector.

Upvotes: 1

Related Questions