Ale*_*een 3 python pypi python-3.x anaconda
我正在尝试将我的包上传到PyPi并想出了这个错误:
Traceback (most recent call last):
File "setup.py", line 11, in <module>
author_email= #my email,
File "C:\Programming\Python\Anaconda\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Programming\Python\Anaconda\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Programming\Python\Anaconda\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Programming\Python\Anaconda\lib\distutils\command\upload.py", line 63, in run
self.upload_file(command, pyversion, filename)
File "C:\Programming\Python\Anaconda\lib\distutils\command\upload.py", line 73, in upload_file
raise AssertionError("unsupported schema " + schema)
Run Code Online (Sandbox Code Playgroud)
由于python setup.py register -r pypitest不再需要上传包,我运行此命令:python setup.py sdist upload -r pypitest,在输入我的密码为pypitest后出现错误
这是我setup.py和.pypirc文件的样子.
setup.py
from setuptools import setup
setup(
name='instapi',
packages=['instapi'],
version='0.1',
description='Clean and simple Instagram API for Python 3.x',
url='https://github.com/SemptraStar/instapi',
download_url = 'https://github.com/SemptraStar/instapi/archive/v._0.1.tar.gz',
author= #me,
author_email= #also me,
)
Run Code Online (Sandbox Code Playgroud)
.pypirc
[distutils]
index-servers =
pypi
pypitest
[pypi]
repository=https://pypi.python.org/pypi
username= # username
password= # password
[pypitest]
repository=https://testpypi.python.org/pypi
username= # username
password= # password
Run Code Online (Sandbox Code Playgroud)
更新1
我将存储库URL更改https://upload.pypi.org/legacy/为pypi和https://test.pypi.org/legacy/pypitest.还更新了最新版本的设置工具(36.3.0).没有改变.
小智 5
你需要做的是用麻线.确保版本为1.8+
pip install twinepython setup.py sdist.twine upload --repository pypitest dist/*您的测试上载.twine upload --repository pypi dist/*你的作品上传.我以前也遇到过一些麻烦,但我不记得这是否与您所描述的问题完全相同。旧的 URL 应重定向到新的 URL,但 PyPi 已移动,因此这些 URL 可能并不总是有效。
对 pypi 服务器尝试一下:
https://upload.pypi.org/legacy/
Run Code Online (Sandbox Code Playgroud)
这是 pypitest 的:
https://test.pypi.org/legacy/
Run Code Online (Sandbox Code Playgroud)