Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Uploading Your Python Package to PyPI

Give Feedback

Finally, this video shows you how to publish your Python package to PyPI. Furthermore, additional information about PyPI and packages are given. You can copy and paste the command from below (make sure to execute the command in your projects root directory).

python -m twine upload dist/*

Comments & Discussion

Martin Breuss RP Team on June 19, 2019

Updating your package

If you change something in your code, you’ll have to run the build tools again:

$ python3 setup.py sdist bdist_wheel
$ twine upload dist/*

You might run into the following error:

HTTPError: 400 Client Error: File already exists. See https://pypi.org/help/#file-name-reuse for url: https://upload.pypi.org/legacy/

If that happens to you, check up on 2 things:

  1. Make sure you updated the version number in both files
  2. Delete the old version files from your dist/ directory

Try again - you should be able to upload now! :)

Become a Member to join the conversation.