PyPi服务器响应500

Sib*_*ibi 6 python pypi setup.py

我正在尝试使用以下命令在PyPi上注册我的包:

pyton setup.py register
Run Code Online (Sandbox Code Playgroud)

但它会导致以下错误:

Server response (500): <urlopen error [Errno -2] Name or service not known>
Run Code Online (Sandbox Code Playgroud)

我甚至删除了〜/ .pypirc文件并尝试再次发出命令,但这也会导致相同的错误.我的setup.py脚本如下:

from setuptools import setup
from setuptools import find_packages
setup(
        name="xxxxx",
        version="0.0.1",
        author="someone",
        author_email="someone@gmail.com",
        url="https://github.com/someone",
        packages=['folder_name',],
        license="MIT License",
        description = " Sample Description",
        long_description = open("README").read(),
        install_requires = ["python-mwapi"],
)
Run Code Online (Sandbox Code Playgroud)

Sib*_*ibi 5

从distutils导入设置解决了这个问题.

用这个替换前两行使它工作:

from distutils.core import setup
Run Code Online (Sandbox Code Playgroud)

一旦您使用注册了包名distutils.core,您就可以再次返回并使用setuptoolssetup.py文件.从那时起,一切似乎都很好.