2017-08-26 79 views
1

我想上传一个包到PyPI - 但我似乎无法。试图上传失败:如何使用python setup.py上传?

C:\pphp>python setup.py upload 
running upload 
Password: 
error: No dist file created in earlier command 

但我已经创建了一个dist文件!

然后我发现有这样的问题,一个问题 - 接受的答案是python setup.py sdist upload,它仍然没有奏效:

C:\pphp>python setup.py sdist upload 
running sdist 
running egg_info 
writing pphp.egg-info\PKG-INFO 
writing top-level names to pphp.egg-info\top_level.txt 
writing dependency_links to pphp.egg-info\dependency_links.txt 
reading manifest file 'pphp.egg-info\SOURCES.txt' 
writing manifest file 'pphp.egg-info\SOURCES.txt' 
running check 
creating pphp-1.2.2a1 
creating pphp-1.2.2a1\pphp.egg-info 
copying files to pphp-1.2.2a1... 
copying README.rst -> pphp-1.2.2a1 
copying setup.py -> pphp-1.2.2a1 
copying pphp.egg-info\PKG-INFO -> pphp-1.2.2a1\pphp.egg-info 
copying pphp.egg-info\SOURCES.txt -> pphp-1.2.2a1\pphp.egg-info 
copying pphp.egg-info\dependency_links.txt -> pphp-1.2.2a1\pphp.egg-info 
copying pphp.egg-info\top_level.txt -> pphp-1.2.2a1\pphp.egg-info 
Writing pphp-1.2.2a1\setup.cfg 
Creating tar archive 
removing 'pphp-1.2.2a1' (and everything under it) 
running upload 
Password: (my pypi pass) 
Submitting dist\pphp-1.2.2a1.tar.gz to https://upload.pypi.org/legacy/ 
Upload failed (403): Invalid or non-existent authentication information. 
error: Upload failed (403): Invalid or non-existent authentication information. 

因为我以为这曾与这大概不会被注册的事,我用python setup.py register

C:\pphp>python setup.py register 
running register 
running egg_info 
writing pphp.egg-info\PKG-INFO 
writing top-level names to pphp.egg-info\top_level.txt 
writing dependency_links to pphp.egg-info\dependency_links.txt 
reading manifest file 'pphp.egg-info\SOURCES.txt' 
writing manifest file 'pphp.egg-info\SOURCES.txt' 
running check 
We need to know who you are, so please choose either: 
1. use your existing login, 
2. register as a new user, 
3. have the server generate a new password for you (and email it to you), or 
4. quit 
Your selection [default 1]: 
1 
Username: (my pypi username) 
Password: (password) 
Registering pphp to https://upload.pypi.org/legacy/ 
Server response (410): Project pre-registration is no longer required or supported, so continue directly to uploading files. 

因为它说: “继续直接上传文件”,然后我试图sdist register upload

C:\pphp>python setup.py sdist register upload 
running sdist 
running egg_info 
writing pphp.egg-info\PKG-INFO 
writing top-level names to pphp.egg-info\top_level.txt 
writing dependency_links to pphp.egg-info\dependency_links.txt 
reading manifest file 'pphp.egg-info\SOURCES.txt' 
writing manifest file 'pphp.egg-info\SOURCES.txt' 
running check 
creating pphp-1.2.2a1 
creating pphp-1.2.2a1\pphp.egg-info 
copying files to pphp-1.2.2a1... 
copying README.rst -> pphp-1.2.2a1 
copying setup.py -> pphp-1.2.2a1 
copying pphp.egg-info\PKG-INFO -> pphp-1.2.2a1\pphp.egg-info 
copying pphp.egg-info\SOURCES.txt -> pphp-1.2.2a1\pphp.egg-info 
copying pphp.egg-info\dependency_links.txt -> pphp-1.2.2a1\pphp.egg-info 
copying pphp.egg-info\top_level.txt -> pphp-1.2.2a1\pphp.egg-info 
Writing pphp-1.2.2a1\setup.cfg 
Creating tar archive 
removing 'pphp-1.2.2a1' (and everything under it) 
running register 
We need to know who you are, so please choose either: 
1. use your existing login, 
2. register as a new user, 
3. have the server generate a new password for you (and email it to you), or 
4. quit 
Your selection [default 1]: 
1 
Username: (username) 
Password: (password) 
Registering pphp to https://upload.pypi.org/legacy/ 
Server response (410): Project pre-registration is no longer required or supported, so continue directly to uploading files. 
running upload 
Password: (password) 
Submitting dist\pphp-1.2.2a1.tar.gz to https://upload.pypi.org/legacy/ 
Upload failed (403): Invalid or non-existent authentication information. 
error: Upload failed (403): Invalid or non-existent authentication information. 

因此,由于不再需要注册,我在做什么错误sdist upload?我是否应该输入我的PyPI密码(我正在尝试的)或其他什么东西,还是需要先做一件独立的事情?

+0

的可能重复[我怎样注册一个包的PyPI?](https://stackoverflow.com/questions/40022710/how-am-i-supposed-to-register-a-package-to- pypi) – phd

+0

“验证信息无效或不存在”。暗示你可能只是使用了错误的密码。 – jwodder

+0

@jwodder但在这种情况下,我应该使用哪个密码?我肯定使用了正确的PyPI密码 - 我想知道是否使用了错误的密码。 –

回答

0

我使用的Linux,而不是和twine工作得很好 - 有一定有什么事情我搞砸了Windows上。这已经解决了!

这样的大多数问题也应该进行一次的PyPI从https://pypi.python.org迁移到https://pypi.org也解决了。