【问题标题】:why i cant install my package using pypi and i have error? [duplicate]为什么我不能使用 pypi 安装我的包并且我有错误? [复制]
【发布时间】:2020-05-02 00:34:17
【问题描述】:

这是我的 icaptcha 包的 setup.py,它可以创建简单的图像验证码

import pathlib
from setuptools import setup

# The directory containing this file
HERE = pathlib.Path(__file__).parent

# The text of the README file
README = (HERE / "README.md").read_text()

# This call to setup() does all the work
setup(
    name="ICaptcha",
    version="2.0.0",
    description="Create Simple Image Captcha For Normal Use",
    long_description=README,
    long_description_content_type="text/markdown",
    url="https://github.com/imanhpr/ICaptcha",
    author="Iman Hosseini Pour",
    author_email="imanhpr1999@gmail.com",
    license="MIT",
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.8",
    ],
    packages=['icaptcha'],
    include_package_data=True,
    install_requires=["pillow"],

)

我在 pypi 中上传了它,当我尝试安装我的包时,我看到了这个错误

pip install icaptcha
ERROR: Could not find a version that satisfies the requirement string (from ICaptcha) (from versions: none) 
ERROR: No matching distribution found for string (from ICaptcha)

这是什么错误,我该如何解决?

【问题讨论】:

  • 只是为了确保:这似乎是一个仅限 Python3 (3.8) 的项目,您是否仔细检查过您是否尝试使用 Python 3.8 解释器安装它? path/to/python3.8 -m pip install ICaptcha

标签: python module package setuptools setup.py


【解决方案1】:

您已将包上传到 Test PyPI:https://test.pypi.org/project/ICaptcha/

但不是 PyPI:https://pypi.org/project/ICaptcha/ 返回错误 404。

使用来自 PyPI 的依赖项从 Test PyPI 安装:

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ ICaptcha

或者上传到 PyPI 并重复

pip install ICaptcha

【讨论】:

  • 我在 pypi 上上传了它,但是当我看到那个错误时我决定删除它
猜你喜欢
  • 2021-12-25
  • 1970-01-01
  • 1970-01-01
  • 2019-07-22
  • 2016-04-17
  • 1970-01-01
  • 2020-05-18
  • 1970-01-01
  • 2020-12-04
相关资源
最近更新 更多