All modules in Python have to have a certain directory structure. You can find details here.

Create an empty file called __init__.py under the model directory, such that your directory structure would look something like that:

.
└── project
    └── src
        ├── hello-world.py
        └── model
            ├── __init__.py
            └── order.py

Also in your hello-world.py file change the import statement to the following:

from model.order import SellOrder

That should fix it

P.S.: If you are placing your model directory in some other location (not in the same directory branch), you will have to modify the python path using sys.path.

Answer from RafazZ on Stack Overflow
🌐
Python.org
discuss.python.org › python help
Module not found but it's already installed - Python Help - Discussions on Python.org
March 26, 2024 - I’m fairly new to Python. I use Python 3.11.8 (what MS Azure supports, my eventual production environment) on Windows 10. I’m testing a program on Windows 10. I have created and activated my virtual environment in the cmd.exe window. My program is in c:\users\MYUSER\onedrive - ...
Discussions

Visual Studio Python Module Not Found
I'm trying to use Python in Visual Studio 2022 Community Edition. Whenever I try to import module I get this message. The modules are listed in the Solution Explorer. Can you tell me how the fix this. Traceback (most recent call last): File… More on learn.microsoft.com
🌐 learn.microsoft.com
1
1
January 14, 2023
Why do I get "Module not found" after python installation in venv? | The FreeBSD Forums
Hello Goal My goal is to set up a Python application in a virtual environment in FreeBSD, and run it from there. Setup I have created the virtual environment, activated it, installed pip within this and ran pip install -r requirements.txt The installation went well, and I could list out all... More on forums.freebsd.org
🌐 forums.freebsd.org
November 9, 2022
Module Not Found -- Importing My Own Modules
I am running my multi-page streamlit app locally right now, and I have tried multiple approaches to solving this issue (I see others have the same issue) which is I need to import classes I created into a pages/_1_page.py. So I have tried three approaches: APPROACH 1: Use the following folder ... More on discuss.streamlit.io
🌐 discuss.streamlit.io
5
3
March 24, 2024
ModuleNotFoundError: No module named 'Directory_one'
Hi All, I am trying to access method from another module in one of my file but I keep getting ModuleNotFoundError. This how my folder structure is: Appreciate for your help Thanks Lax More on discuss.python.org
🌐 discuss.python.org
2
0
August 26, 2021
🌐
Reddit
reddit.com › r/learnpython › why do i get a modulenotfounderror?
r/learnpython on Reddit: Why do I get a ModuleNotFoundError?
September 2, 2021 -

Hey Guys,

I get a weird ModuleNotFoundError in one of my projects and i do not really understand why. So here is my Folder Structure:

Project\

| main.py

| packageabc\

| | __init__.py

| | abc.py

| | packagexyz\

| | | xyz.py

In every .py file is an abc/xyz or main class. Now the interesting part. Inside the abc.py I do an import like this:

from packagexyz.xyz import xyz

This works perfectly fine!

Inside the main.py I do an import like this:

from packageabc.abcimport abc

Now I get an ModuleNotFoundError. Error Code looks like this:

from packagexyz.xyz import xyz ModuleNotFoundError: no module named packagexyz.

So the import in the abc.py File that works perfectly when tested inside the file does not work if the abc.py file is imported. So why is that?

Top answer
1 of 2
2
You probably have a circular dependency - abc imports xyz and xyz imports abc. Python can't complete either import so it raises an error.
2 of 2
1
It's because of the way Python looks for modules. There's a list of paths that Python looks through to find modules, which automatically includes things like the place pip installs packages to. It also automatically includes the directory the executing script is in. It does not, however, automatically include the directory an imported module is in. So, if you're executing "abc.py" directly, in finds "packagexyz" just fine, since it knows to look in the "packageabc" folder for modules. If you are executing "main.py" instead, the only place it looks (besides the default and manually configured paths) is "Project", so it can't find packagexyz. There's really three ways you could fix this: Manually configuring paths You can keep the imports as you have them and simply ensure that the "packageabc" folder is always on the search path for modules. You can do so either by configuring the PYTHONPATH environment variable to include it or by appending it to sys.path in your "main.py" before importing abc. Absolute imports You could also change the import in "abc.py" to be relative to "Project" (from packageabc.packagexyz.xyz import xyz). Then your "main.py" would work the way it is. Of course, that in turn means you can no longer directly execute "abc.py" unless you manually configure "Project" to always be on the search path for modules. Relative imports You could also change "abc.py" to use relative imports (from .packagexyz.xyz import xyz, note the extra dot in front). Then your "main.py" would work the way it is, as well. You could also still directly execute "abc.py", but only if you make sure to do it in a way that Python is aware it is part of a larger package (otherwise, relative imports give you an error). Specifically, you'd always need to execute it like this: python -m packageabc.abc Rather than like this: python packageabc/abc.py
🌐
OneUptime
oneuptime.com › home › blog › how to fix 'modulenotfounderror' in python
How to Fix 'ModuleNotFoundError' in Python
January 24, 2026 - # This fails if requests is not installed import requests # ModuleNotFoundError: No module named 'requests' # Using pip pip install requests # If you have multiple Python versions pip3 install requests # Using a specific Python interpreter python3 -m pip install requests # With conda conda install requests
🌐
YouTube
youtube.com › watch
How to Fix Module Not Found Error in Python - ModuleNotFound Error (FIXED) - YouTube
In this video, I'll show you how you can fix the ModuleNotFound error in Python. The module not found error (ModuleNotFoundError) in python occurs when a spe...
Published: July 25, 2024
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-fix-the-module-not-found-error
How to Fix The Module Not Found Error - Python
July 1, 2026 - A ModuleNotFoundError, occurs when Python cannot locate the module you are trying to import. This usually happens when the module is not installed, the module name is incorrect, or Python cannot find it in its search path.
Find elsewhere
🌐
Medium
carlkho-cvk.medium.com › why-is-my-python-module-not-found-in-my-virtual-environment-779c37cd2d2c
Why is My Python Module Not Found in My Virtual Environment? | by Carl Kho | Medium
October 3, 2024 - If these paths aren’t pointing inside your virtual environment’s bin directory (e.g., ./my_venv/bin), then you’ve found the culprit! This is especially common when using tools like Homebrew (Macbook folks raise your hands 🙌), which can sometimes override your system’s default Python.
🌐
freeCodeCamp
freecodecamp.org › news › module-not-found-error-in-python-solved
ModuleNotFoundError: no module named Python Error [Fixed]
September 12, 2022 - The following code will throw a module not found error: ... The reason for this is that we have used the wrong path to access the test1 module. The right path should be demoA.test1. When you correct that, the code works: ... For resolving an imported module, Python checks places like the inbuilt library, installed modules, and modules in the current project.
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 1160881 › visual-studio-python-module-not-found
Visual Studio Python Module Not Found - Microsoft Q&A
January 14, 2023 - If you added different versions ... pandas again. Please try to create a new Python project, install the pandas and import it directly, and test to see if the pandas module can be found....
🌐
FreeBSD
forums.freebsd.org › development › userland programming and scripting
Why do I get "Module not found" after python installation in venv? | The FreeBSD Forums
November 9, 2022 - Python has its own virtual environments. They have nothing to do with OS-level constructs you listed. They reach the same goal (having multiple applications run on the same machine, with different set of libraries = modules) in a different way. Documentation is here: https://docs.python.org/3/tutorial/venv.html I tried them once for 10 minutes, and decided that they're not for me.
🌐
Facebook
facebook.com › groups › pypcom › posts › 2098271270509931
How to fix 'module not found' error in Python
Explore the things you love · Log into Facebook · English (US) · Español · Français (France) · 中文(简体) · العربية · Português (Brasil) · Italiano · More languages…
🌐
Streamlit
discuss.streamlit.io › using streamlit
Module Not Found -- Importing My Own Modules - Using Streamlit - Streamlit
March 24, 2024 - I am running my multi-page streamlit app locally right now, and I have tried multiple approaches to solving this issue (I see others have the same issue) which is I need to import classes I created into a pages/_1_page.py. So I have tried three approaches: APPROACH 1: Use the following folder structure: |__frontend |___main.py |___util_1.py |___pages |__page.py In page.py I want to import MyClass, a class found in util_1.py.
🌐
Medium
medium.com › @mischu-learn › python-module-not-found-ultimate-guide-a41399e9216c
Python module not found — Ultimate guide
September 5, 2022 - Add venv-python directory to the end of existing value, separated with colon: /user/local/lib/python3.9/site-packages:/Users/USERNAME/code/PROJECTNAME/venv/bin/python3
🌐
LabEx
labex.io › tutorials › python-how-to-handle-modulenotfounderror-in-python-417559
How to handle ModuleNotFoundError in Python | LabEx
This ensures that the Python interpreter can find the module. import sys sys.path.append('/path/to/module/directory') import some_module · Wrap your import statements in try-except blocks to catch and handle ModuleNotFoundError gracefully. This allows your program to continue running even if a module is not found.
🌐
GeeksforGeeks
geeksforgeeks.org › python › modulenotfounderror-no-module-named-error-in-python
ModuleNotFoundError: No module named Error in Python - GeeksforGeeks
July 23, 2025 - The most common reason for this error is that the required module is not installed on the system. Python relies on external packages and modules to extend its functionality, and if a module is not installed, Python cannot find it during the import.
🌐
Python.org
discuss.python.org › python help
ModuleNotFoundError: No module named 'Directory_one' - Python Help - Discussions on Python.org
August 26, 2021 - Hi All, I am trying to access method from another module in one of my file but I keep getting ModuleNotFoundError. This how my folder structure is: Appreciate for your help Thanks Lax
🌐
Microsoft Community
community.fabric.microsoft.com › t5 › Fabric-platform › Python-Module-Not-Found-Error-When-Importing-Pandas-no-module › m-p › 4610289
Re: Python Module Not Found Error When Importing Pandas: 'no module named 'fsspec_wrapper.trident.co
May 15, 2025 - ... This issue seems to stem from a recent change in how Fabric handles internal dependencies—particularly around the fsspec_wrapper.trident.core module, which is now required when importing pandas in custom environments.
🌐
iO Flood
ioflood.com › blog › python-no-module-named
[SOLVED] 'No Module Named' Python Error Solutions
January 30, 2024 - If the module is not installed, you can install it using the pip install command. Here’s an example: pip install your_module # Output: # Successfully installed your_module-version · Replace your_module with the name of the module you want to install. Once installed, you should be able to import it in your Python code without the ‘No Module Named’ error.
🌐
Python documentation
docs.python.org › 3 › tutorial › modules.html
6. Modules — Python 3.15.1 documentation
When a module named spam is imported, the interpreter first searches for a built-in module with that name. These module names are listed in sys.builtin_module_names. If not found, it then searches for a file named spam.py in a list of directories given by the variable sys.path.