Skip to content

Should I run `python setup.py`?

No. Commands like python setup.py sdist, python setup.py bdist_wheel, and python setup.py install are deprecated. Setuptools deprecated direct setup.py invocation because it let packages run arbitrary Python at install time with no standard interface. PEP 517 (2017) replaced that model with a stable interface between installers and build backends.

Build a package

Use uv build or python -m build (build) instead of python setup.py sdist or python setup.py bdist_wheel:

$ uv build           # builds both sdist and wheel
$ uv build --sdist   # sdist only
$ uv build --wheel   # wheel only

If you are not using uv, install build and invoke it directly:

$ pip install build
$ python -m build

Install from source

Use pip install instead of python setup.py install or python setup.py develop:

$ pip install .              # replaces setup.py install
$ pip install --editable .   # replaces setup.py develop

Learn More

Last updated on