close

[Solved] AttributeError: module ‘setuptools._distutils’ has no attribute ‘version’

Hello Guys, How are you all? Hope You all Are Fine. Today I am facing following error while running my python project AttributeError: module ‘setuptools._distutils’ has no attribute ‘version’ in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How AttributeError: module ‘setuptools._distutils’ has no attribute ‘version’ Error Occurs ?

I am facing following error while running my python project.

AttributeError: module 'setuptools._distutils' has no attribute 'version'

How To Solve AttributeError: module ‘setuptools._distutils’ has no attribute ‘version’ Error ?

  1. How To Solve AttributeError: module 'setuptools._distutils' has no attribute 'version' Error ?

    To Solve AttributeError: module 'setuptools._distutils' has no attribute 'version' Error If You are using pytorch and You are facing this error then You should try to use nightly-release of PyTorch. Now, Your error should be solved.

  2. AttributeError: module 'setuptools._distutils' has no attribute 'version'

    To Solve AttributeError: module 'setuptools._distutils' has no attribute 'version' Error You Just need to downgrade setuptools to 59.5.0 version. And Now, Your error must be solved. First of all Just install setuptools with help of this command: pip uninstall setuptools Then run this command to install setuptools 59.5.0. For Python 3: python3 -m pip install setuptools==59.5.0 For Python 2 python2 -m pip install setuptools==59.5.0 Now, Your error should be fixed.

Solution 1: downgrade setuptools

You Just need to downgrade setuptools to 59.5.0 version. And Now, Your error must be solved. First of all Just install setuptools with help of this command.

pip uninstall setuptools

Then run this command to install setuptools 59.5.0.

For Python 3

python3 -m pip install setuptools==59.5.0

For Python 2

python2 -m pip install setuptools==59.5.0

Now, Your error should be fixed.

Solution 2: Use nightly-release of PyTorch

If You are using pytorch and You are facing this error then You should try to use nightly-release of PyTorch. Now, Your error should be solved.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment