VS Code 2 errors: 1st is "Import 'solcx' could not be resolved." 2nd issue is given in terminal as "INFO: Could not find files for the given patterns

Solution 1:

This is for resolving the first error: Exit from any virtual environments by running deactivate (or "conda deactivate" for exiting from an Anaconda virtual environment).

Run python3 from the terminal

Run these lines of code as follows:

  import solcx

  solcx.install_solc() #or you can install a specific version by running "solcx.install_solc('0.6.0')"(without the quotes) or any other version in the brackets.

As for the second error, check if the SimpleStorage.sol file is present in the same directory as the given python code file. And also the "compiled_code.json" file will automatically be created in the same folder as that of the given python file(due to the "w" argument present in the open function).