我有一个Python模块,我已经发布给Pip了,但是我很难自己安装它,我也不知道为什么。
下面是我遇到的错误,尽管1.0.3确实发布在注册表上:https://pypi.org/project/Discord-Webhooks/
Could not find a version that satisfies the requirement Discord-Webhooks==1.0.3 (from -r requirements.txt (line 2)) (from versions: )
No matching distribution found for Discord-Webhooks==1.0.3 (from -r requirements.txt (line 2))这就是我的setup.py文件的样子。在构建项目时,运行python3 setup.py sdist bdist_wheel不会产生任何错误。
from setuptools import setup, find_packages
long_description = open('README.md').read()
setup(
name='Discord Webhooks',
version='1.0.3',
py_modules=['discord_webhooks'],
url='https://github.com/JamesIves/discord-webhooks',
author='James Ives',
author_email='email@email.com',
description='Easy to use package for Python which allows for sending of webhooks to a Discord server.',
long_description=long_description,
license='MIT',
install_requires=[
'requests==2.21.0'
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Other Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
],
)我是不是漏掉了什么?为什么我不能运行pip install Discord-Webhooks而没有错误?我在运行Python 3.6.0。
发布于 2019-01-06 16:52:43
您已经上传了一个用Python2构建的轮子,它是由Python标记py2表示的,其名称是:Discord_Webhooks-1.0.3-py2-none-any.whl。您需要上传使用Python 3构建的轮子:
$ python3 setup.py bdist_wheel您还可以显式地指定标记:
$ python3 setup.py bdist_wheel --python-tag=py3然后,您也可以使用Python2构建py3轮(当然,如果安装脚本不使用任何不兼容的代码)。如果您的代码同时运行Python 2和3,另一种可能是构建一个通用轮:
$ python3 setup.py bdist_wheel --universal这将产生一个带有python py2.py3的轮子,这两个主要版本都可以安装。
https://stackoverflow.com/questions/54062815
复制相似问题