I'm trying to regsiter my package on PyPi, with the following command:
pyton setup.py register
But it results in the following error:
Server response (500): <urlopen error [Errno -2] Name or service not known>
I even deleted the ~/.pypirc file and tried again issuing the command but that too results in the same error. My setup.py script is as follows:
from setuptools import setup
from setuptools import find_packages
setup(
name="xxxxx",
version="0.0.1",
author="someone",
author_email="[email protected]",
url="https://github.com/someone",
packages=['folder_name',],
license="MIT License",
description = " Sample Description",
long_description = open("README").read(),
install_requires = ["python-mwapi"],
)
Importing setup from distutils solved the issue.
Replacing the first two lines with this made it work:
from distutils.core import setup
And once you have registered your package name using distutils.core, you can again go back and use setuptools in your setup.py file. From then on everything seems to work fine.
Check your internet connection, and whether a firewall on the network or on the machine you are working on might be restricting your access.
Next step in troubleshooting is to specify the Pypi server:
python setup.py register -r http://pypi.python.org/pypi
then if still failing mysteriously try to run a local Pypi server (pypiserver) and run the command above while specifying that server.
Adding this to my ~/pypirc worked for me as explained in Uploading to PyPI.
[distutils]
index-servers=pypi
[pypi]
repository = https://pypi.python.org/pypi
[pypi]
username:your_username
password:your_password
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With