from solcx import compile_standard, install_solc
print("install start")
install_solc("v0.7.0")
print("install finish")
with open("./SimpleStorage.sol", "r") as file:
simple_storage_file = file.read()
print(simple_storage_file)
print("finished downloading")
# Compile our solidity
compiled_sol = compile_standard(
{
"language": "Solidity",
"sources": {"SimpleStorage.sol": {"content": simple_storage_file}},
"settings": {
"outputSelection": {
"*": {"*": ["abi", "metadata", "evm.bytecode", "evm.sourceMap"]}
},
},
},
solc_version="0.7.0",
)
print("Here si the results")
print(compiled_sol)由于某些原因,代码只是继续加载到install_solc("v0.7.0"),并且不会继续前进并打印以下行"install finish“。我通过conda安装py-solc-x,因为我在conda环境中运行python。python运行的是3.7.11
我试图理解为什么会发生这种无限的加载。如有任何帮助,我们不胜感激!
发布于 2021-11-27 17:21:26
这只发生在我第一次运行install_solc("0.6.0")的时候。我很不耐烦,一直退出,因为我认为出了问题,但如果你让它完成,它就永远不会再做了(至少对那个版本是这样)。大约花了五分钟(!)对我来说。
顺便说一句,我认为v0.7.0是不正确的--你不需要包含v。
https://stackoverflow.com/questions/69248293
复制相似问题