I am attempting to import pygames into my script so that I may have more robust control over how my controller works. However whenever I try to run the script I get the error: “Error running script cannot import base from pygame”. I wish I knew what exactly this error meant, but after scouring the internet nothing has turned up.
Here’s the snippet of code for how I’m importing the module. I also have the pygame folder in site-packages of Python27, Mission Planner, and the directory of my python script.
import sys
sys.path.append(r"D:\Python27\Lib\site-packages")
sys.path.append(r"D:\Python27\Lib")
import math, os
from time import sleep
import pygame
from pygame.locals import *
Did you ever figure out the right way to import modules? I am new to both Python and Mission Planner and am trying to write a script using ttsx. I have no idea how to get MP to find and use the module. Thanks!