无法将项目上传到pypi

时间:2018-04-30 15:11:59

标签: python anaconda pypi

我正在尝试将项目上传到pypi,但是我使用此命令setup.py sdist upload -r pypitest失败了。

 File "setup.py", line 3, in <module>
    setup(name='spongebot', version='1.0', packages=find_packages(), description = 'Upload a gif of Spongebob')
  File "C:\Users\Javier Jiménez\Anaconda3\lib\site-packages\setuptools\__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "C:\Users\Javier Jiménez\Anaconda3\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Javier Jiménez\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Users\Javier Jiménez\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Javier Jiménez\Anaconda3\lib\distutils\command\upload.py", line 63, in run
    self.upload_file(command, pyversion, filename)
  File "C:\Users\Javier Jiménez\Anaconda3\lib\distutils\command\upload.py", line 73, in upload_file
    raise AssertionError("unsupported schema " + schema)
AssertionError: unsupported schema

似乎来自setup.py

from setuptools import setup, find_packages

setup(
    name='spongebot', 
    version='1.0', 
    packages=find_packages(), 
    description = 'Upload a gif of Spongebob',
)

1 个答案:

答案 0 :(得分:1)

修改您的~/.pypirc文件,确保包含架构(&#34; https&#34;):

[distutils]
index-servers=
    pypi
    pypitest

[pypitest]
repository = https://test.pypi.org/legacy/
username = your.username

[pypi]
# repository = https://pypi.python.org/pypi
username = your.username