,我提交了第一個項目的PyPI昨晚的事情都無法正常運行(警告後長提前)...PyPI將上傳停止工作和PIP安裝失敗
我最初上傳的項目,cvrfparse,通過命令行在做:
% python setup.py sdist upload
這創建了初始項目就好了。然而嘗試通過PIP安裝工程,正是如此失敗:
% sudo pip install cvrfparse
Password:
Downloading/unpacking cvrfparse
Running setup.py egg_info for package cvrfparse
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/private/tmp/pip-build-root/cvrfparse/setup.py", line 3, in <module>
from distribute_setup import use_setuptools
ImportError: No module named distribute_setup
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/private/tmp/pip-build-root/cvrfparse/setup.py", line 3, in <module>
from distribute_setup import use_setuptools
ImportError: No module named distribute_setup
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /private/tmp/pip-build-root/cvrfparse
Storing complete log in /Users/m/Library/Logs/pip.log
根據http://pythonhosted.org/distribute/setuptools.html#using-setuptools-without-bundling-it它應該只是 「工作」,如果我有:
在setup.py的loadcard後。然後我嘗試添加distribute_setup.py到MANIFEST.in按:
% cat MANIFEST.in
include distribute_setup.py
添加該文件,並在setup.py碰撞的版本號後,於是,我又試圖上傳新包的PyPI:
% python setup.py sdist upload
running sdist
running egg_info
writing requirements to cvrfparse.egg-info/requires.txt
writing cvrfparse.egg-info/PKG-INFO
writing top-level names to cvrfparse.egg-info/top_level.txt
writing dependency_links to cvrfparse.egg-info/dependency_links.txt
writing entry points to cvrfparse.egg-info/entry_points.txt
reading manifest file 'cvrfparse.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'cvrfparse.egg-info/SOURCES.txt'
running check
creating cvrfparse-0.10
creating cvrfparse-0.10/cvrfparse
creating cvrfparse-0.10/cvrfparse.egg-info
creating cvrfparse-0.10/cvrfparse/sample-xml
creating cvrfparse-0.10/cvrfparse/schemata
creating cvrfparse-0.10/cvrfparse/schemata/common
creating cvrfparse-0.10/cvrfparse/schemata/common/1.1
creating cvrfparse-0.10/cvrfparse/schemata/cvrf
creating cvrfparse-0.10/cvrfparse/schemata/cvrf/1.1
creating cvrfparse-0.10/cvrfparse/schemata/dublincore
creating cvrfparse-0.10/cvrfparse/schemata/prod
creating cvrfparse-0.10/cvrfparse/schemata/prod/1.1
creating cvrfparse-0.10/cvrfparse/schemata/scap
creating cvrfparse-0.10/cvrfparse/schemata/vuln
creating cvrfparse-0.10/cvrfparse/schemata/vuln/1.1
creating cvrfparse-0.10/cvrfparse/schemata/w3.org
making hard links in cvrfparse-0.10...
hard linking MANIFEST.in -> cvrfparse-0.10
hard linking README -> cvrfparse-0.10
hard linking distribute_setup.py -> cvrfparse-0.10
hard linking setup.py -> cvrfparse-0.10
hard linking cvrfparse/__init__.py -> cvrfparse-0.10/cvrfparse
hard linking cvrfparse/cvrfparse.py -> cvrfparse-0.10/cvrfparse
hard linking cvrfparse.egg-info/PKG-INFO -> cvrfparse-0.10/cvrfparse.egg-info
hard linking cvrfparse.egg-info/SOURCES.txt -> cvrfparse-0.10/cvrfparse.egg-info
hard linking cvrfparse.egg-info/dependency_links.txt -> cvrfparse-0.10/cvrfparse.egg-info
hard linking cvrfparse.egg-info/entry_points.txt -> cvrfparse-0.10/cvrfparse.egg-info
hard linking cvrfparse.egg-info/requires.txt -> cvrfparse-0.10/cvrfparse.egg-info
hard linking cvrfparse.egg-info/top_level.txt -> cvrfparse-0.10/cvrfparse.egg-info
hard linking cvrfparse/sample-xml/CVRF-1.1-cisco-sa-20110525-rvs4000.xml -> cvrfparse-0.10/cvrfparse/sample-xml
hard linking cvrfparse/schemata/catalog.xml -> cvrfparse-0.10/cvrfparse/schemata
hard linking cvrfparse/schemata/common/1.1/common.xsd -> cvrfparse-0.10/cvrfparse/schemata/common/1.1
hard linking cvrfparse/schemata/cvrf/1.1/cvrf.xsd -> cvrfparse-0.10/cvrfparse/schemata/cvrf/1.1
hard linking cvrfparse/schemata/dublincore/dc.xsd -> cvrfparse-0.10/cvrfparse/schemata/dublincore
hard linking cvrfparse/schemata/prod/1.1/prod.xsd -> cvrfparse-0.10/cvrfparse/schemata/prod/1.1
hard linking cvrfparse/schemata/scap/cpe-language_2.2a.xsd -> cvrfparse-0.10/cvrfparse/schemata/scap
hard linking cvrfparse/schemata/scap/cvss-v2_0.9.xsd -> cvrfparse-0.10/cvrfparse/schemata/scap
hard linking cvrfparse/schemata/scap/scap-core_0.9.xsd -> cvrfparse-0.10/cvrfparse/schemata/scap
hard linking cvrfparse/schemata/vuln/1.1/vuln.xsd -> cvrfparse-0.10/cvrfparse/schemata/vuln/1.1
hard linking cvrfparse/schemata/w3.org/xml.xsd -> cvrfparse-0.10/cvrfparse/schemata/w3.org
Writing cvrfparse-0.10/setup.cfg
Creating tar archive
removing 'cvrfparse-0.10' (and everything under it)
running upload
Traceback (most recent call last):
File "setup.py", line 21, in <module>
['cvrfparse = cvrfparse.cvrfparse:main',]}
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/upload.py", line 60, in run
self.upload_file(command, pyversion, filename)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/upload.py", line 135, in upload_file
self.password)
TypeError: cannot concatenate 'str' and 'NoneType' objects
看起來好像有些東西是None
以前的地方?
我又試圖通過通過創建分發手動上傳軟件包:
% python setup.py sdist
,並通過網頁界面上傳該文件的PyPI。 pip安裝仍然報告與這個新的.10包相同的問題。我哪裏錯了?
對於該行,用戶名或密碼都是「無」。檢查你的主目錄中的'.pypirc'文件。 – 2013-03-15 21:01:39
用戶名無誤,密碼被省略。根據http://docs.python.org/2/distutils/packageindex#the-pypirc-file如果密碼字段被省略,用戶將被提示輸入它。我嘗試添加一個空的密碼「'password:'」,然後我從服務器「上傳失敗(401):未經授權」出現401錯誤。「問題仍未解決。 – 2013-03-15 23:20:43
更多信息:我重新編譯$ python setup.py註冊表並重新提示輸入登錄名/密碼信息,我選擇保存到〜/ .pypirc。接下來,我做了'$ python setup.py sdist upload',這又給出了另一個錯誤信息:'上傳失敗(400):錯誤請求'。 – 2013-03-15 23:28:37