python setup_tools install_required

标签 python pip

<分区>

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

setuptools.setup(
    name="mylidar",
    version="0.1",
    author="xxxxxxxxxx",
    author_email="xxxxxxxxxx",
    description="xxxxxxxxxxxxxxxxxxxxxxxxxx",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    packages=["xxxxxxxxxxx"],
    install_requires=[
        'pyserial',
    ],
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
    ],
)

我想将我的包发布到 https://test.pypi.org .我用命令

python setup.py sdist bdist_wheel

python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*

我成功地将我的项目上传到 pypi 中,但是当我使用 pip 安装它时出现错误

>>pip install -i https://test.pypi.org/simple/ mylidar
Looking in indexes: https://test.pypi.org/simple/
Collecting lidar
  Downloading https://test-files.pythonhosted.org/packages/fb/f0/c7b2e9002550d775625f789e4917969a58b9a8c0495c18500fed8545e321/lidar-0.1-py3-none-any.whl
Collecting pyserial (from lidar)
  Could not find a version that satisfies the requirement pyserial (from lidar) (from versions: )
No matching distribution found for pyserial (from lidar)

最佳答案

您将 pyserial 命名为依赖项。使用 pip install --index ... 安装时,您将默认索引替换为 test.pypi.orgthere is no pyserial那里。

要允许安装依赖项,请尝试将 PyPI 添加为额外索引:

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

关于python setup_tools install_required,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54743649/

相关文章:

python - 如何使用 miniconda 获得一个完全干净的 python 环境?

python - 使用 matplotlib 的动画交互式绘图

python - 最长公共(public)前缀仅在字符串中给出 0 索引

python - 使用 pip 安装 Python 包源 tarball

python - 如何使用 pip 安装带有额外组件的本地 Python 包?

python - 将 python 列表增加 mod x_i 的量,其中 x_i 取决于位置

python - python 中的最大迭代项和关键属性

python - Mac OS-X Mountain Lion 上的 GCC-4.2 错误,无法使用 pip/virtualenv 安装某些包

python - 将从远程存储库获取的Python包传递给spark Submit/shell

python - 如何使用替代构建配置 'pip install uwsgi'?