smartcontractkit / full-blockchain-solidity-course-py

Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
MIT License
10.72k stars 2.89k forks source link

Lesson 4 : installing solc #1499

Open LouCse59 opened 2 years ago

LouCse59 commented 2 years ago

Hey, having a problem with solc-x version "solc 0.6.0 has not been installed" from lesson 4. I already changed the lines, my code is the exact same from the github under the video:

"import json

from web3 import Web3

from solcx import compile_standard, install_solc import os from dotenv import load_dotenv

load_dotenv()

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

print("Installing...") install_solc("0.6.0")

Solidity source code

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

oloridama commented 2 years ago

Traceback (most recent call last): File "C:\Users\3\demos\web3_py_simple_storage\deploy.py", line 6, in install_solc(_solc_version) File "C:\Users\3\AppData\Local\Programs\Python\Python39\lib\site-packages\solcx\install.py", line 466, in install_solc
raise exc File "C:\Users\3\AppData\Local\Programs\Python\Python39\lib\site-packages\solcx\install.py", line 459, in install_solc
_validate_installation(version, solcx_binary_path) File "C:\Users\3\AppData\Local\Programs\Python\Python39\lib\site-packages\solcx\install.py", line 636, in _validate_installation raise SolcInstallationError( solcx.exceptions.SolcInstallationError: Downloaded binary would not execute, or returned unexpected output.

I keep getting this when i run the code using python deploy.py I'm using windows 10, don't know if that's the problem, please help i've been on this for 3 days.