Skip to content

Lesson 4: "No module named solcx". #1556

@MarcoNValenzuela

Description

@MarcoNValenzuela

Hi there, I realize a similar question was raised by another user but they seem to have found a solution which doesn't work for me. The other solution was posted here: #1473.

I am using Windows, Python version 3.10.5. I use "pip install py-solc-x" on my terminal and it seems to install properly ("requirements already satisfied"), but when I run "from solcx import compile_standard" on a python file, it gives me the "No module named solcx" error. I can import other modules such as numpy fine. I also checked, and I am pretty sure I have the Solidity extension installed on Visual Studio Code.

Heres the text which appears over the code, it says "Import "solcx" could not be resolved Pylance(reportMissingImports)"
image
I can only guess what this exactly means.

Running the "help(modules)" command, I cant see solcx on the list of modules it gives, so maybe I'm installing it to the wrong place somehow? This seems to me like a very specific issue that is going to be different for every user

So I suppose my strategy to solving this is:
Where should solcx be?
Is the "from" command looking in the right place?
How do I change where the "from" command is looking for modules?
Am I installing solcx to the wrong place? If so, how do I change the installation path.
Maybe the solcx command should be preceded by something akin to a file path, indicating where Python should look for it?

Any pointers would be appreciated :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions