Search code examples
pythonpippypitwine

Uploading a Python package into PyPI


I am following the instructions in the PyPI link below to upload my Python package into PyPI: https://packaging.python.org/tutorials/packaging-projects/

but I am stuck at the step where I need to run twine after installing it, which is the step below:

Once installed, run Twine to upload all of the archives under dist:

python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*

When I ran the above command in the command prompt (I am using cmd in Windows), I get the following message:

'twine' is not recognized as an internal or external command, operable program or batch file.

What am I doing wrong? Do I need to change directory after installing twine from the directory where I pip installed twine to the directory where my dist/* folder is sitting? Or I somehow did not install twine properly? (I did get some warning messages when I installed twine but it did say twine was successfully installed at the end - I have attached an image of the warning messages here).

twine_issues


Solution

  • Yes, the issue is the warnings: twine is not being installed where Python can find it. Omitting the --user flag will likely fix this, or editing the PATH as it suggests.