Home > OS >  How do I solve "Key/value pairs are not allowed within a set Pylance" error in visual stud
How do I solve "Key/value pairs are not allowed within a set Pylance" error in visual stud

Time:03-08

I was following this tutorial on "Solidity, Blockchain, and Smart Contract Course – Beginner to Expert Python Tutorial"
I created "SimpleStorage.sol" for solidity and for deploying that I was writing "deploy.py"(timestamp 3:42:30s). Here's the code for the deploy.py :

from solcx import compile_standard

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

#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.6.0",
)

print(compiled_sol)

whenever I am trying to set the parameters in the compile_standard function, I am getting this "Key/value pairs are not allowed within a setPylance" problem.

How do I solve this issue?

CodePudding user response:

find the line "language: Solidity". Please change this to "language": "Solidity". Python recognizes this as a set, not a dictionary.

  • Related