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

pyton setup.py register

但这会导致以下错误:
Server response (500): <urlopen error [Errno -2] Name or service not known>

我什至删除了〜/.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"],
)

最佳答案

从distutils导入安装程序解决了该问题。

以此替换前两行使其工作:

from distutils.core import setup

并且使用distutils.core注册了程序包名称后,您可以再次返回并在setup.py文件中使用setuptools。从那时起,一切似乎都运转良好。

关于python - PyPi服务器响应500,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14219499/

10-16 07:02