How to separate custom modules from my main program into a subdirectory without getting a "Module Not Found Error"?
10:28 09 Jan 2026

So I have a lot of custom modules to import into my .py file. If I could store them into a single directory it would be a lot easier to find the main program.

I am making a Bible quiz specifically, which is why I need all of these modules. Each module contains questions, like Genesis has 50, Exodus has 40, Leviticus has 27, etc. This is the first book, that I still have not finished:

# Genesis.py
import random
def int_errorcheck(num):
    try:
        num = int(num)
        return num
    except:
        print("You must enter an integer value!")
def check_if_right(choice):
    global mychoice
    global score
    mychoice = input()
    mychoice = int_errorcheck(mychoice)
    if mychoice == choice:
        print("Correct!")
        score += 1
    else:
        print("The answer was", choice)
def question(value):
    global score
    if value == 1:
        print('On which day of creation were amphibians created?')
        print('1. Day 5')
        print('2. Day 6')
        print('3. Day 7')
        print('4. Natrual selection')
        check_if_right(2)
    elif value == 2:
        print("Which of these statements is true?")
        print("1. The Pishon river flows through the land of Cush.")
        print("2. The Tigris river flows west of Assyria.")
        print("3. The Gihon river flows through the land of Cush.")
        print("4. The fourth river is named the Havailah.")
        check_if_right(3)
    elif value == 3:
        print("Why did Eve eat the forbidden fruit?")
        print("1. She wanted to become like God")
        print("2. The serpent deceived her")
        print("3. It looked good")
        print("4. All of the above")
        check_if_right(3)
    elif value == 4:
        print("Which of these statements are true:")
        print("1. Abel was older, took care of sheep")
        print("2. Abel was younger, took care of crops/plants")
        print("3. Cain was younger, took care of sheep")
        print("4. Cain was older, took care of crops/plants")
        check_if_right(4)
    elif value == 5:
        print("When did Noah have Shem, Ham, and Japheth?")
        print("1. 500 years")
        print("2. 520 years")
        print("3. 540 years")
        print("4. 560 years")
        check_if_right(1)
    elif value == 6:
        print("What material was the ark made of?")
        print("1. Oak wood")
        print("2. Gopher wood")
        print("3. Birch wood")
        print("4. Spruce wood")
        check_if_right(2)
    elif value == 7:
        print("What word did God use for Noah's family entering the Ark?")
        print("1. 'You and all your household'")
        print("2. 'You and all your group'")
        print("3. 'You and all your family'")
        print("4. 'You and all your kids'")
        check_if_right(1)
    elif value == 8:
        print("How long did the ark stay on the water?")
        print("1. 40 days")
        print("2. 150 days")
        print("3. 187 days")
        print("4. 370 days")
        check_if_right(4)
    elif value == 9:
        print("What does the rainbow represent?")
        print("1. A promise")
        print("2. LGBTQ+")
        print("3. Something beautiful")
        print("4. It dosen't represent anything")
        check_if_right(1)
    elif value == 10:
        print("Which child of Noah had the most sons?")
        print("1. Ham")
        print("2. Japheth")
        print("3. Shem")
        print("4. They all had the same number")
        check_if_right(2)
    else:
        score += 1
def main():
    input("Ready to begin?")
    global score
    score = 0
    print('Bible Quiz')
    print('----------')
    for i in range(0, 50):
        question(random.randrange(1, 51))
    print(f"Your score was {score} out of {i + 1}.")

My goal here is to separate the custom modules from my main program, so that the main program would be a lot easier to find, but when I try to do that, I get a ModuleNotFoundError:

import genesis
genesis.question(random.randrange(1, 11))

And also: to clean up all the libraries, how do I import all 66 of my custom modules without the code looking like this:

import genesis
import exodus
import leviticus
import numbers
import deuteronomy
import joshua
import judges
# etc...
python