How To Fix Python Importerror: No Module Named Setuptools

When i run my python code, i meet an import error. The error message is : ImportError: No module named setuptools. The reason for this error is because we do not install setuptools module, so to fix it, we just need to install setuptools module.

1. Install Python setuptools Module.

  1. First we should download setuptools package. Open a terminal and run below wget command to download setuptools module.
    l# wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
  2. Run tar command to unpack above downloaded package.
    # unpack setuptools package.
    # tar zxvf setuptools-0.6c11.tar.gz
    # goto unpacked directory
    # cd setuptools-0.6c1
  3. Compile setuptools with python build command.
    # python setup.py build
  4. Install setuptools package use python install command. After you complete installation, the error will be fixed.
    # python setup.py install