As you must be aware that modulenotfounderror mainly comes when the python interpreter is unable to find the module in the system. If you are getting the modulenotfounderror no module named ‘packaging’ then this post is for you. In this tutorial, you will learn how to solve this issue easily.
Why modulenotfounderror no module named ‘packaging’ occurs?
The root or main cause of getting packaging modulenotfounderror is that your system is unable to find the packaging module. The packaging module allows you to implement the interoperability specifications.
You will get the modulenotfounderror when you will run the below lines of code.
from packaging.version import Version
Here I am trying to import the Version modulefrom the packaging package but getting the no module named packaging error.
Solve no module named ‘packaging’ Error
As I stated in the previous section that you are getting the error as the packaging module must not be installed in your system. To remove the error you have to install the packaging module using the pip command.
But before that, you should also check the version of python. If the python version is 3. xx then use the pip3 command and if it is 2. xx then use the pip command.
Run the following bash command to install the packaging module.
Python 3. xx
pip3 install packaging
Python 2. xx
pip install packaging
Now you will not get the error when you import the Version module into the packaging library.
If you want to install the packaging module on anaconda then use the following bash command on your anaconda command prompt.
conda install packaging
In most of that cases, you will get the modulenotfounderror when any package is not installed in your system. To solve this error you have to install the module in the systems. The above solution will solve the error modulenotfounderror no module named ‘packaging‘.
If you have any queries and still facing issues 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.