Skip to content →

What is setuptools in Python?

You’ve seen it before. You know it might be related to pip. You know it’s definitely related to setup.py.

Well, it’s a Python library, but it’s not built-in to the language distribution, so you have to install it.

pip install setuptools

Once installed you can use it in your setup.py file. This file is used by developers who want to distribute their application by making is a package that someone else can install with pip.

A very basic setup.py file looks like this

from setuptools import setup

setup(
    name='myapp',
    version='v0.0.1',
    packages=['myapp'],
    author='me',
    description='this is myapp'
)

Notice how we imported the setup function from setuptools.

Published in Today I Learned