Modulenotfounderror no module named ‘packaging’ ( Solved )

Modulenotfounderror no module named 'packaging' ( Solved )

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

Output

no module named packaging error
no module named packaging error

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.

pypi packaging offical website
pypi packaging official website

If you want to install the packaging module on anaconda then use the following bash command on your anaconda command prompt.

conda install packaging

Conclusion

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.

Thank you for signup. A Confirmation Email has been sent to your Email Address.

Something went wrong.

Meet Sukesh ( Chief Editor ), a passionate and skilled Python programmer with a deep fascination for data science, NumPy, and Pandas. His journey in the world of coding began as a curious explorer and has evolved into a seasoned data enthusiast.
 
Thank you For sharing.We appreciate your support. Don't Forget to LIKE and FOLLOW our SITE to keep UPDATED with Data Science Learner