So I have a python script located on my desktop as well as a package I made called testpackage. It contains three scripts each containing one function which prints a word. Here is a sample of one of the scripts.
def dog():
print ("Dog")
I also have an __init__.py
file and contains the following.
import sys, os
pathVar = os.path.normpath('/Desktop/testpackage')
from cat import *
from dog import *
from horse import *
The file on my desktop, named myFile.py, contains the following
from testpackage import dog
dog.dog()
When I run this script, I get an error along the lines of
File 'myFile.py", line1, in from testpackage import dog. File "C:\Users\User\Deskop\testpackage__init__.py", line 3 in from cat import * ModuleNotFoundError: No Module named 'cat'
I have tried every trick under the sun that i've found on google so I'm wondering why it can't locate the script from the __init__
file.