Search code examples
pythonmodulemodulenotfounderror

"ModuleNotFoundError: No module named '...' even though module is installed


Trying to import "libgen_api" module but get "Module not found" error.

Pip install libgen-api shows "requirement already satisfied" and the module exists in the python folder as well.

The documentation of the module says that it has to be called with libgen_api.

Other modules work fine. I am using VScode but the problem persists in the python terminal as well. I apologize if this question is redundant but so far I have not been able to find a solution anywhere.


Solution

  • The problem was that VScode sys.path showed python38-32 but the module was installed in python39. To fix the issue go to View -> Command pallete -> select interpreter and make sure to use the version under which pip installed the module.

    This answered my question. How can I change python version in Visual Studio Code?