How to set up Setuptools for Python on Windows?
Setuptools is a package development process library that is designed to make packaging Python projects easier by boosting the standard distutils (distribution utilities) library of Python.
- It includes Python package and module definitions
- It includes distribution package metadata
- It includes test hooks
- It includes project installation
- It also includes platform-specific details
- It supports Python3.
In this article, we will learn how to install Setuptools for Python on Windows.
Installing Setuptools on Windows
Method 1: Using pip to install Setuptools Package
Follow the below steps to install the Setuptools package on Windows using pip:
Step 1: Install the latest or current version of Python3 in Windows.
Step 2: Now check if pip and python are correctly installed in your system using the following commands.
python –version
pip –version
Step 3: Upgrade pip to the latest version to avoid errors during installation.
pip install –upgrade pip
Step 4: Enter the following command in the command prompt to install Setuptools using pip.
pip install setuptools
Method 2: Using setup.py to install Setuptools
Follow the below steps to install the Setuptools on Windows using the setup.py file:
Step 1: Download the latest source package of Setuptools for Python3 from here.
curl https://files.pythonhosted.org/packages/9b/be/13f54335c7dba713b0e97e11e7a41db3df4a85073d6c5a6e7f6468b22ee2/setuptools-60.2.0.tar.gz > setuptools-60.2.0.tar.gz
Step 2: Extract the downloaded package using the given command.
tar -xzvf setuptools-60.2.0.tar.gz
Step 3: Go to the setuptools-60.2.0 folder and enter the following command to install the package.
cd setuptools-60.2.0
python setup.py install
Verifying Setuptools installation on Windows
Make the following import in your Python terminal to verify if the installation of the Setuptools package has been done properly:
import setuptools
If there is any error while importing the module then the Setuptools package is not installed properly.
Contact Us