0
votes

I'm trying to upload a custom python library to Azure artifacts for sharing amongst our team. I'm trying to upload using twine. I've used pip to install twine and everything seems to have worked correctly, however when I try to run the following command:

twine upload --repository-url https://pkgs.dev.azure.com/<your-organization-name>/_packaging/<your-feed-name>/pypi/upload

(obviously substituting --repository-url, your-organization-name and your-feed-name with the apt. information)

I get the error:

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

implying that twine is not installed.

Any help would be hugely appreciated.

1
Do you see the expected output when you run python3 -m twine --version (Assuming you are running Python3) ?Bhargavi Annadevara

1 Answers

1
votes

The error implies that twine was not installed properly.

You can run python -m twine --version to check if you see the expected version as the output, something similar to:

twine version 3.2.0 (pkginfo: 1.5.0.1, requests: 2.24.0, setuptools: 49.2.1, requests-toolbelt: 0.9.1, tqdm: 4.53.0)

If you run into errors, then:

  1. Download Python

  2. Re-run the installation with this command to install Twine and the keyring:

    pip install twine keyring artifacts-keyring
    

And then attempt to Publish Packages:

  1. Run this command in your project directory to create source and wheel distributions.

    python setup.py sdist bdist_wheel
    
  2. Then, run this command to publish:

    twine upload --repository-url https://pkgs.dev.azure.com/<your-organization-name>/<your-project-name>/_packaging/<your-feed-name>/pypi/upload dist/*