【问题标题】:install_requires in setup.py file of Python package errors [duplicate]Python 包错误的 setup.py 文件中的 install_requires [重复]
【发布时间】:2020-10-24 12:02:37
【问题描述】:

我正在构建一个 Python 包,我的包有一些安装要求。这是我的 setup.py 文件代码:

import setuptools

with open("README.md", "r") as fh:
    long_description = fh.read()

setuptools.setup(
    name="simpleEDA", 
    version="0.0.1",
    author="Muhammad Shahid Sharif",
    author_email="chshahidhamdam@gmail.com",
    description="A wrapper around Pandas to perform Simple EDA with less code.",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="github link here",
    packages=['simple_eda'],
    install_requires = ['matplotlib',
'numpy',
'numpydoc',
'pandas',
'scikit-image',
'scikit-learn',
'scipy',
'seaborn'],
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independen.t",
    ],
    python_requires='>=3.5',
)

我已经创建了 whl 文件并将其上传到测试 PyPI。这是链接

pip install -i https://test.pypi.org/simple/ simpleEDA==0.0.1

如果我尝试安装它,它会给我这个错误。

  Could not find a version that satisfies the requirement numpydoc (from simpleEDA==0.0.1) (from versions: )
No matching distribution found for numpydoc (from simpleEDA==0.0.1)

为什么我的 install_requires 不起作用?为什么不安装库?

【问题讨论】:

  • numpydoc 需要Sphinx1.6.5+ pypi
  • 所以?它应该自动安装其他依赖项
  • 我是否应该在 install_requires 中也包含 sphinx?
  • 找不到满足matplotlib要求的版本(来自simpleEda==0.0.1)(来自版本:)没有找到matplotlib的匹配分布(来自simpleEda==0.0.1)
  • 现在它在 matplotlib 中给我错误

标签: python pip pypi python-packaging


【解决方案1】:

您正在尝试使用 TestPyPI 作为索引进行安装:

pip install -i https://test.pypi.org/simple/ simpleEDA==0.0.1

但是您的大多数子依赖项在 TestPyPI 上不存在,例如 https://test.pypi.org/project/numpydoc/ 是 404。

根据您使用 TestPyPI 的目的,您最好在 PyPI 上创建 pre-release

【讨论】:

    猜你喜欢
    • 2011-08-30
    • 1970-01-01
    • 1970-01-01
    • 2013-01-02
    • 2012-04-06
    • 2016-10-08
    • 1970-01-01
    • 2018-04-05
    相关资源
    最近更新 更多