python setup_tools install_required - PullRequest
       1

python setup_tools install_required

0 голосов
/ 18 февраля 2019
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 Iполучаю ошибку

>>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)

1 Ответ

0 голосов
/ 18 февраля 2019

Вы назвали pyserial в качестве зависимости.При установке с pip install --index … вы заменили индекс по умолчанию на test.pypi.org и , там нет pyserial .

Чтобы разрешить установку зависимостей, попробуйте добавить PyPI в качестве дополнительного индекса:

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ mylidar
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...