ModuleNotFoundError is an error you get when the python interpreter is unable to find the module in your system. If you are getting the error no module named config then in this post you will know all the solutions that can solve the error modulenotfounderror no module named ‘config’ error.
Why modulenotfounderror no module named ‘config’ error occurs?
The reasons for getting this error can be many. But the following are the main reason that gives you an error,
1. The config module is not installed in your system.
The first reason that leads to this error is that your system has not found the config module. You will get the modulenotfounderror when you try to import the config module.
Modulenotfounderror no module named 'config'
To solve this issue you have to install the config module in your system.
For python 3. xx
pip3 install config
For python 2. xx
pip install config
2. Typo error
The second reason you may get the error is that there must be a spelling error in the module. Most developers write conf instead of config and it leads to modulenotfounderror.
To solve this error you must ensure that you are correctly using the word config. Don’t import conf instead import config.
3. The system is unable to find the python path
The third reason for getting this Modulenotfounderror no module named ‘config’ error is that the python path is not properly set. And due to this config module is not set in your path environment variables.
Open your terminal or command prompt and type the following command to set the path of the environment variable PYTHONPATH.
The config module is used to store configuration information for applications. Most of the developer name the config file config.py. This makes it very easy to import settings when you are building a large application. If you are getting the Modulenotfounderror no module named ‘config’ error then the above methods will solve it.
I hope you have liked this tutorial. If you are still getting this error then you can contact us for more help.
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.