1

I have a problem with my code. I have seen similiar threats in this group and I have applied all of the steps unfortunately without any luck...

Could anyone pls help...:

from solcx import compile_standard, install_solc 
install_solc("0.6.0") 

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


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")

I get the following error:

INFO: Could not find files for the given pattern(s).
Traceback (most recent call last):
  File "C:\Users\VSCode-win32-x64-1.40.1\Project\demos\web3_py_simple_storage\deploy.py", line 9, in <module>
    compiled_sol = compile_standard(
  File "C:\UsersPython\Python310\lib\site-packages\solcx\main.py", line 394, in compile_standard
    raise SolcError(
solcx.exceptions.SolcError: Only "Solidity" or "Yul" is supported as a language.
> command: `C:\Users\.solcx\solc-v0.6.0\solc.exe --standard-json`
> return code: `0`
> stdout:
{"errors":[{"component":"general","formattedMessage":"Only \"Solidity\" or \"Yul\" is supported as a language.","message":"Only \"Solidity\" or \"Yul\" is supported as a language.","severity":"error","type":"JSONError"}]} 

> stderr:

I have installed the npm install -g solc aswell

1 Answer 1

1

Found a solution:

Solidity needs to be written with capital "S"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.