【问题标题】:Published pypi package shows up on search but won't pip install已发布的 pypi 包显示在搜索中,但不会 pip install
【发布时间】:2017-07-14 14:20:44
【问题描述】:

我的包已发布但无法安装时遇到以下问题:

$ pip search "intellimatch"
intellimatch (0.1.0)  - Intelligent matching/textsearch/cli interactivity that works for humans

$ pip install intellimatch
Collecting intellimatch
  Could not find a version that satisfies the requirement intellimatch (from versions: )
No matching distribution found for intellimatch

$ pip install intellimatch==0.1.0
Collecting intellimatch==0.1.0
  Could not find a version that satisfies the requirement intellimatch==0.1.0 (from versions: )
No matching distribution found for intellimatch==0.1.0

https://bitbucket.org/codyc54321/intellimatch

setup.py 看起来像

from setuptools import setup

setup(
    name='intellimatch',
    version='0.1.0',
    description='Intelligent matching/textsearch/cli interactivity that works for humans',
    url='https://bitbucket.org/codyc54321/intellimatch',
    author='codyc4321',
    license='MIT',
    packages=['intellimatch'],
    install_requires=[],
    zip_safe=False,
)

这是一个基本包,有 1 个文件夹,intellimatch,没有依赖项,只使用 Python。

【问题讨论】:

    标签: python pip pypi


    【解决方案1】:

    在 pypi 中没有您的项目的存档。请参阅以下步骤。

    $ pip install intellimatch -vvv
    

    这将显示一个调试回溯。

    网址指向https://pypi.python.org/simple/intellimatch/,它没有您的包的存档,因此它不会下载和安装您的包。从搭便车者的guide 获取,使用以下命令上传您的包的分发。

    $ python setup.py register sdist upload
    

    【讨论】:

    • 哇,我想你解决了。我办公室的网络安全可能已经阻止了它或其他什么,如果我失败了,我会在家里尝试这个并提出不同的问题。谢谢
    • open different question if I fail 喜欢人们这样说
    • 好吧,我宁愿现在解决它 :) 我在工作,有很重的防火墙,我没有设置也不懂。通常我只是回家做这样的事情,它的工作原理
    【解决方案2】:

    pip 从 PyPI 下载包。 https://pypi.python.org/pypi/intellimatch 没有软件包,因此无需下载和安装。

    给点子一个VCS URL

    pip install git+https://bitbucket.org/codyc54321/intellimatch/src?egg=intellimatch
    

    【讨论】:

    • 好的,我现在试试,你知道我需要做什么才能正常发布,以便pip install intellimatch 工作吗?我认为我遵循的指南是这样做的......
    • $ pip install git+https://bitbucket.org/codyc54321/intellimatch/src?egg=intellimatch Collecting git+https://bitbucket.org/codyc54321/intellimatch/src?egg=intellimatch Cloning https://bitbucket.org/codyc54321/intellimatch/src?egg=intellimatch to /private/var/folders/20/blah/T/pip-blah-build remote: Not Found fatal: repository 'https://bitbucket.org/codyc54321/intellimatch/src?egg=intellimatch/' not found Command "git clone -q https://bitbucket.org/codyc54321/intellimatch/src?egg=intellimatch /private/var/folders/20/blah/T/pip-blah-build" failed with error code 128 in None
    • 我已经在pypi上注册了,登录后看到包
    • pip install git+https://bitbucket.org/codyc54321/intellimatch/src 确实有效,但这不是我想知道的
    • 如果你想使用 vcs url 那么不需要在 pypi 注册你的包
    猜你喜欢
    • 2021-06-08
    • 1970-01-01
    • 2013-04-04
    • 1970-01-01
    • 2014-02-27
    • 1970-01-01
    • 2018-09-18
    • 2020-09-20
    • 2019-08-27
    相关资源
    最近更新 更多