Home>

Excuse me for the question.
I'm trying to program with python in VScode, but a module called ephem imports
I'm in trouble because I can't do it.

ModuleNotFoundError: No module named'ephem'
Supplementary information (FW/tool version, etc.)

If i go directly to the terminal, it works fine.

  • Answer # 1

    VS Code's Python extension allows you to switch between multiple Python environments. Currently, Python 2.7.16 is used, so modules installed in Python 3.7.6 cannot be used.

    While editing the Python code, click "Python" displayed near the left end of the status bar (bottom line), and "Python 3.7.6" in the list of Python environments displayed in the list at the top. If you have one, select it and VS Code will use Python 3.7.6 from then on.