在安装py-solc后,如果系统还没有安装solidity的话,会遇到以下的问题:
File "/home/ubuntu/.local/lib/python2.7/site-packages/solc/wrapper.py", line 155, in solc_wrapper
stderr=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
所以需要在系统上安装solidity环境才可以运行
在ubuntu上安装solidity环境如下:
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
在安装完solc之后,重新运行就没有问题