Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Python Tutorial
  • Interview Questions
  • Python Quiz
  • Python Glossary
  • Python Projects
  • Practice Python
  • Data Science With Python
  • Python Web Dev
  • DSA with Python
  • Python OOPs
Open In App
Next Article:
Filenotfounderror: Errno 2 No Such File Or Directory in Python
Next article icon

ModuleNotFoundError: No module named Error in Python

Last Updated : 14 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The "No Module Named..." error is raised when Python attempts to import a module that it cannot locate. Modules are essentially Python files containing functions and variables that can be reused in different parts of a program. When Python encounters an import statement, it searches for the specified module in its standard library and other directories. If the module is not found, the "No Module Named..." error is triggered.

Below, are the reasons for occurring ModuleNotFoundError: No module named Error in Python:

  • Module Not Installed
  • Incorrect Module Name
  • Incorrect Directory Structure

Module Not Installed

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.

C++
# Error: ModuleNotFoundError import requests 

Output

Hangup (SIGHUP)
Traceback (most recent call last):
File "Solution.py", line 2, in <module>
import requests
ModuleNotFoundError: No module named 'requests

Incorrect Module Name

Typos or incorrect module names in the import statement can also lead to this error. Python is case-sensitive, so a slight difference in the module name will result in a "No Module Named..." error.

C++
import jso 

Output

Hangup (SIGHUP)
Traceback (most recent call last):
File "Solution.py", line 1, in <module>
import jso
ModuleNotFoundError: No module named 'jso'

Solution for ModuleNotFoundError: No module named in Python

Below, are the approaches to solve ModuleNotFoundError in Python:

  • Installed Module
  • Correct Module Name
  • Correct Directory Structure

Installed Module

To resolve this issue, you need to install the missing module using a package manager like pip. Open your terminal or command prompt and run the following command:

pip install <module_name> or pip install requests

Replace <module_name> with the name of the missing module.

Correct Module Name

Double-check the import statement for typos or incorrect capitalization. Ensure that the module name matches the actual module name.

C++
# Incorrect import jso  # Correct import json 

Correct Directory Structure

Make sure your module is in the correct directory and has the right structure. If your module is part of a package, ensure that the package is properly structured, and use the correct import statement.

C++
# Incorrect from myproject.mymodule import myfunction  # Correct from myproject.package.mymodule import myfunction 

Related Article:

  • How To Fix Modulenotfounderror And Importerror in Python
  • How to Fix 'ModuleNotFoundError: No Module Named psycopg2' in Python
  • How to Fix: No module named NumPy

Next Article
Filenotfounderror: Errno 2 No Such File Or Directory in Python

K

kasoti2002
Improve
Article Tags :
  • Python
  • Python Programs
  • Python Errors
Practice Tags :
  • python

Similar Reads

  • ModuleNotFoundError: No module named 'celery' in Python
    In Real-Time application development, many Programmers and Developers prefer Python language due to its enhanced features and support for different modules and packages. When developers work on various modules they commonly encounter the ModuleNotFoundError: No module named 'celery' error. In this a
    2 min read
  • ModuleNotFoundError: No module named 'dotenv' in Python
    The ModuleNotFoundError: No module named 'dotenv' error is a common hurdle for Python developers dealing with environment variables. This glitch arises when the interpreter can't find the indispensable "dotenv" module. In this brief guide, we'll uncover the reasons behind this issue, outline common
    3 min read
  • Modulenotfounderror: No Module Named 'httpx' in Python
    Python is a versatile and powerful programming language used in various domains. When working with Python, you may encounter the "ModuleNotFoundError: No Module Named 'httpx'" error. This error occurs when the Python interpreter cannot find the required 'httpx' module in its library. In this article
    3 min read
  • Filenotfounderror: Errno 2 No Such File Or Directory in Python
    When working with file operations in programming, encountering errors is not uncommon. One such error that developers often come across is the FileNotFoundError with the Errno 2: No such file or directory message. This error indicates that the specified file or directory could not be found at the gi
    3 min read
  • Python Code Error: No Module Named 'Aiohttp'
    Python is most favourite and widely used programming language that supports various libraries and modules for different functionalities In this article, we are going to see how we can fix the Python Code Error: No Module Named 'Aiohttp'. This error is encountered when the specified module is not ins
    3 min read
  • Os Module Vs. Sys Module In Python
    Python provides a lot of libraries to interact with the development environment. If you need help using the OS and Sys Module in Python, you have landed in the right place. This article covers a detailed explanation of the OS and Sys Module including their comparison. By the end of this article, you
    5 min read
  • No Module Named 'Sqlalchemy-Jsonfield' in Python
    In this article, we are going to see how we can fix the Python Code Error: "No Module Named 'Sqlalchemy-Jsonfield'". This error is encountered when the specified module is not installed in our Python environment. We will try to reproduce the error and resolve it with the proper solutions demonstrate
    3 min read
  • Python Filenotfounderror Winerror 3
    Python, being a versatile and widely used programming language, encounters various error messages during development. One common error that developers may encounter is the "FileNotFoundError WinError 3." This error indicates that Python is unable to find the specified file, and the underlying operat
    3 min read
  • No Module Named Sqlalchemy-Utils in Python
    In Python Programming, when working with various modules and inbuilt packages, we always face and encounter the error of No Module Named 'Sqlalchemy-Utils. In this article, we are going to see how we can fix the Python Code Error: No Module Named 'Sqlalchemy-Utils'. This error is encountered when th
    3 min read
  • How to Fix ImportError: Cannot Import name X in Python
    We are given an error "Importerror: Cannot Import Name ‘X’ From ‘Collections’ " in Python and our task is to find the solution for this error. In this article we will see the reasons for occurring and also the solution for the Importerror: Cannot Import Name ‘X’ From ‘Collections’ " error in Python.
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences