我正在尝试将我的包上载到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)

由于上载包不再需要python setup.py register -r pypitest,因此我运行以下命令:python setup.py sdist upload -r pypitest,并在输入pypitest的密码后出现错误
下面是我的setup.py.pypirc文件的外观。
Stuff.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,
)

.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

更新1
我将pypi的存储库URL更改为https://upload.pypi.org/legacy/,pypitest的存储库URL更改为https://test.pypi.org/legacy/还更新了最新版本(36.3.0)的设置工具。什么都没变。

最佳答案

除了从项目的根目录中添加.pypirc文件外,在主目录中也添加C:\Users\<username>文件对我有效。

08-20 03:38