Python

從原始碼安裝 web3.py,命令“python setup.py egg_info”失敗,錯誤程式碼為 1

  • February 22, 2018

嘗試從原始碼安裝 web3.py 並pip install -e .在 web3 目錄中執行此操作時出現此錯誤。

RuntimeError: 格式缺失,但需要一個(將源標識為文本,因為未找到具有該名稱的文件)。

命令“python setup.py egg_info”失敗,錯誤程式碼 1 在 /private/var/folders/t2/g8zfp3jd5y388nvcx5_f9qm00000gn/T/pip-build-AjPzos/ethereum-keyfile/

參考:https ://pypi.python.org/pypi/web3/3.16.2

輸出:

$ pip install -e .
Obtaining file:///Users/joeyz/Projects/Eth/web3.py
Collecting cytoolz>=0.8.2 (from web3==4.0.0b2)
 Downloading cytoolz-0.9.0.tar.gz (443kB)
   100% |████████████████████████████████| 450kB 2.1MB/s 
Collecting ethereum-abi-utils>=0.4.3 (from web3==4.0.0b2)
 Using cached ethereum-abi-utils-0.4.7.tar.gz
Collecting ethereum-keyfile>=0.3.0 (from web3==4.0.0b2)
 Using cached ethereum-keyfile-0.3.1.tar.gz
   Complete output from command python setup.py egg_info:
   Maybe try:

       brew install pandoc
   See http://johnmacfarlane.net/pandoc/installing.html
   for installation options
   ---------------------------------------------------------------

   zip_safe flag not set; analyzing archive contents...
   pypandoc.__init__: module references __file__


   !!! pandoc not found, long_description is bad, don't upload this to PyPI !!!



   Installed /private/var/folders/t2/g8zfp3jd5y388nvcx5_f9qm00000gn/T/pip-build-AjPzos/ethereum-keyfile/.eggs/pypandoc-1.4-py2.7.egg
   Traceback (most recent call last):
     File "<string>", line 1, in <module>
     File "/private/var/folders/t2/g8zfp3jd5y388nvcx5_f9qm00000gn/T/pip-build-AjPzos/ethereum-keyfile/setup.py", line 33, in <module>
       'Programming Language :: Python :: 3.5',
     File "/Users/joeyz/Projects/Eth/web3.py/venv/lib/python2.7/site-packages/setuptools/__init__.py", line 129, in setup
       return distutils.core.setup(**attrs)
     File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
       _setup_distribution = dist = klass(attrs)
     File "/Users/joeyz/Projects/Eth/web3.py/venv/lib/python2.7/site-packages/setuptools/dist.py", line 333, in __init__
       _Distribution.__init__(self, attrs)
     File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
       self.finalize_options()
     File "/Users/joeyz/Projects/Eth/web3.py/venv/lib/python2.7/site-packages/setuptools/dist.py", line 476, in finalize_options
       ep.load()(self, ep.name, value)
     File "/private/var/folders/t2/g8zfp3jd5y388nvcx5_f9qm00000gn/T/pip-build-AjPzos/ethereum-keyfile/.eggs/setuptools_markdown-0.2-py2.7.egg/setuptools_markdown.py", line 22, in long_description_markdown_filename
       output = pypandoc.convert(markdown_filename, 'rst')
     File "/private/var/folders/t2/g8zfp3jd5y388nvcx5_f9qm00000gn/T/pip-build-AjPzos/ethereum-keyfile/.eggs/pypandoc-1.4-py2.7.egg/pypandoc/__init__.py", line 66, in convert
       raise RuntimeError("Format missing, but need one (identified source as text as no "
   RuntimeError: Format missing, but need one (identified source as text as no file with that name was found).

   ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/t2/g8zfp3jd5y388nvcx5_f9qm00000gn/T/pip-build-AjPzos/ethereum-keyfile/

web3.py v4 是 py3-only,看起來你正在嘗試用它來建構它python2.7

如果你想建構仍然支持 py2 的 v3,那麼v3在執行之前檢查分支pip install。請注意,v3 即將退出,v4 將穩定realsoonnow。


看起來您也遇到了文件建構錯誤。

Maybe try:

    brew install pandoc

你試過這個 ^ 嗎?

引用自:https://ethereum.stackexchange.com/questions/39822