python - 为什么我不能使用 pypi 安装我的包并且我有错误?
问题描述
这是我的 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)
这是什么错误,我该如何解决?
解决方案
您将包上传到 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
推荐阅读
- android - 如何从 recyclerView 中删除项目?
- python - 给出公差比较列表中的浮点数
- php - 为前端选择网站架构/逻辑/结构以及如何实现它
- azure - Azure Functions:为什么我在 Kudu 中看到两个 w3wp 进程?
- python-3.x - 使用 kivymd 的文件管理器代码不起作用
- css - 变暗背景但不是内部内容 - React / Ionic /CSS
- php - 登录尝试修改与另一列
- php - 内部 orderBy 被 Laravel Eloquent 中的外部 orderBy 覆盖
- python - Python中的NameError处理
- rest - 能否从 Azure DevOps REST API 获取项目开始日期?