Importerror no module named sysconfig error usually comes when python-setuptools is not installed or path is not set properly. In this article, We will see how to install or reinstall the python-setuptools.
Importerror no module named sysconfig : ( Fix ) –
sysconfig is the module of python-setuptools package. Hence if the python-setuptools is not properly installed and we invoke the sysconfig module in our code. We get the same error (Importerror no module named sysconfig ). Let’s see the installation command for python-setuptools package.
python-setuptools Installation –
Firstly, please use the below command.
yum install python-setuptools
Secondly, Please make sure that you should remove the pkg_resources folder from site-packages.
After you need to run the below command.
pip --version pip (pip_version) from /usr/lib/python(version)/site-packages (python version)
Here the pip_version and python version are configurational parameter. We may change it at our convenience. One more important thing the above commands are Linux oriented.
Most importantly, The setuptools gives a complete finishing for packaging a python project. It is a tool to formally build and distribute the python packages among the developers and end-users.
Real Scenarios for (no module named sysconfig) :
- In most of the cases where we use pip on a RedHat Server system. we get the same error. Usually because of the default python version of OS ( Linux ) and the version which we externally install.
- Not only in RedHat OS but CentOS has the same issue with this cause.
- Python 2.7.11, Anaconda 2.4.1 (64-bit). No admin permissions for local install. Actually, this is another reason for the above error. Hence if we use virtualenv here for dependency installation. We may easily fix the issue because now it will not be for each user.
To sum up, I hope you must like this article. If you have any doubt and suggestions please comment below in the comment box. Our team will connect with you.
Data Science Learner Team
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.