1

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

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Leockl
  • 1,906
  • 5
  • 18
  • 51

1 Answers1

1

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.

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82
  • Thanks, I have now done this by editing the `PATH` and have installed twine without errors. I am now getting another error in the next step when I run `python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*`. The error I am getting is 'InvalidDistribution: Cannot find file : 'dist/*''. I have followed the [guide](https://packaging.python.org/tutorials/packaging-projects/) and there is a dist folder that I have created in the prior steps. – Leockl Jan 17 '20 at 08:47
  • The guide has a space between `...legacy/` and `dist/*`. Is there meant to be a space here? – Leockl Jan 17 '20 at 09:02
  • Ok, I managed to resolve my issues. Couldn't find `dist/*` because I needed to change directories. And yes, there needs to be a space between `...legacy/` and `dist/*` – Leockl Jan 17 '20 at 09:54