Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There can be many reasons for encountering a ModuleNotFoundError when using your own modules in Python3. Some possible reasons include:

  1. Incorrect module name or file name: Make sure that the name of your module and the file name match, and that the file is saved with a .py extension. Also ensure that the module is saved in the correct directory.

  2. Incorrect import statement: Make sure that you are importing the module correctly, using the correct syntax for your particular situation. For example, if your module is in a subfolder, you may need to use a relative import.

  3. Module not installed: If you are trying to use a third-party module that is not installed on your system, you will need to install it first using pip.

  4. Environment issues: Sometimes, the environment or system settings can cause problems with finding modules. Check to make sure that your Python environment is set up correctly, including any virtual environments you may be using.

  5. Python version incompatibility: If your module was written using an earlier version of Python, it may not be compatible with Python3. Check that your code is compatible with the version of Python you are using.