gpt4 book ai didi

python - 使用外部 dowload_url 将包注册到 PyPi

转载 作者:太空宇宙 更新时间:2023-11-04 06:09:28 25 4
gpt4 key购买 nike

我正在尝试通过将包注册到 PyPI 并使用指向 bitbucket zip 文件的外部 download_url 来分发包。可以找到使用的安装文件 here .我使用

打包它
$ python setup.py sdist register

但是,pip 或 easy_install 找不到包

$ pip install PyBlockWork
Downloading/unpacking PyBlockWork
Could not find any downloads that satisfy the requirement PyBlockWork
Cleaning up...
No distributions at all found for PyBlockWork
Storing complete log in C:\Users\oreichri\pip\pip.log

pip 日志文件如下所示:

------------------------------------------------------------
C:\Python27\Scripts\pip-script.py run on 10/30/13 14:17:36
Downloading/unpacking PyBlockWork

Getting page https://pypi.python.org/simple/PyBlockWork/
URLs to search for versions for PyBlockWork:
* https://pypi.python.org/simple/PyBlockWork/
Analyzing links from page https://pypi.python.org/simple/PyBlockWork/
Could not find any downloads that satisfy the requirement PyBlockWork

Cleaning up...

Removing temporary dir c:\users\oreichri\appdata\local\temp\pip_build_oreichri...
No distributions at all found for PyBlockWork

Exception information:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip-1.4.1-py2.7.egg\pip\basecommand.py", line 134, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip-1.4.1-py2.7.egg\pip\commands\install.py", line 236, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python27\lib\site-packages\pip-1.4.1-py2.7.egg\pip\req.py", line 1085, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "C:\Python27\lib\site-packages\pip-1.4.1-py2.7.egg\pip\index.py", line 265, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for PyBlockWork

download urlhttps://pypi.python.org/pypi/PyBlockWork/0.1.0 上可用并正常运行但 pip 似乎只看 https://pypi.python.org/simple/PyBlockWork/其中不包含链接。我想 setup.py 文件中一定有问题,但我不知道是什么。

最佳答案

这个问题的长答案在于 PEP 438 .简短的回答是,通过 PyPi 分发 python 包正在重新定义中。默认情况下,新注册的包被置于 pip 不再访问“url”和“download_url”的模式。此外,链接不会自动添加到 https://pypi.python.org/simple/[package_name]/网页。要恢复到旧行为,可以登录他/她的 PyPi 帐户并在他/她的包的“url”选项卡中选择“如上所述,但也要求工具抓取主页和下载 URL(慢!)”作为托管模式.当然,这有很多含义,可以通过阅读一些关于这个主题的文章来理解。阅读PEP 438是一个很好的起点,但对于那些想要了解更多信息的人来说,here is also a good place to go .

关于python - 使用外部 dowload_url 将包注册到 PyPi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19690971/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com