简体   繁体   English

将自定义 python 库上传到 azure 工件

[英]Uploading custom python library to azure artifacts

I'm trying to upload a custom python library to Azure artifacts for sharing amongst our team.我正在尝试将自定义 Python 库上传到 Azure 工件,以便在我们的团队之间共享。 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:我已经使用 pip 安装 twine 并且一切似乎都正常工作,但是当我尝试运行以下命令时:

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) (显然用 apt. 信息替换 --repository-url、your-organization-name 和 your-feed-name)

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.任何帮助将不胜感激。

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:您可以运行python -m twine --version来检查您是否看到预期版本作为输出,类似于:

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下载 Python

  2. Re-run the installation with this command to install Twine and the keyring:使用此命令重新运行安装以安装 Twine 和密钥环:

     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/*

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM