首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >问题与py-solc-x库

问题与py-solc-x库
EN

Ethereum用户
提问于 2021-10-20 14:08:49
回答 1查看 564关注 0票数 0

我不知道我的代码出了什么问题,也不知道我安装和导入这个库的方式有什么问题,但我一直在接收这个错误,我也不知道如何处理它。我降级并升级了版本,但没有发生任何事情,同样的错误。我会附上你的代码和错误。也许你们能帮我解决这个问题。

代码语言:javascript
复制
from solcx import compile_standard, install_solc

with open("./SimpleStorage.sol", "r") as file:
    simple_storage_file = file.read()

# Compile our Solidity
print("Installing...")
install_solc('v0.4.11')

compiled_sol = compile_standard(
    {
        "language": "Solidity",
        "sources": {"SimpleStorage.sol": {"content": simple_storage_file}},
        "settings": {
            "outputSelection": {
                "*": {"*": ["abi", "metadata", "evm.bytecode", "evm.sourceMap"]}
            }
        },
    },
    solc_version="0.6.0",
)

print(compiled_sol)

这是一个错误:

代码语言:javascript
复制
Installing...
solc, the solidity compiler commandline interface
Version: 0.6.0+commit.26b70077.Windows.msvc
Traceback (most recent call last):
  File "C:\Users\Mihigh\lesson5\web3_py_simple_storage\deploy.py", line 10, in <module>
    compiled_sol = compile_standard(
  File "C:\Users\Mihigh\AppData\Local\Programs\Python\Python310\lib\site-packages\solcx\main.py", line 143, in compile_standard
    stdoutdata, stderrdata, command, proc = solc_wrapper(
  File "C:\Users\Mihigh\AppData\Local\Programs\Python\Python310\lib\site-packages\solcx\utils\string.py", line 78, in inner
    return force_obj_to_text(fn(*args, **kwargs))
TypeError: solc_wrapper() got an unexpected keyword argument 'solc_version'
PS C:\Users\Mihigh\lesson5\web3_py_simple_storage> 
EN

回答 1

Ethereum用户

发布于 2021-11-05 03:51:29

看来你错了"install_solc“,你试过这个吗?

代码语言:javascript
复制
install_solc("0.6.0")
票数 0
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/111905

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档