0

I'm maintaining a python file, which contains the following code. It worked fine before, but when I modify the code and debug, it occurs an error, which says "Exception has occurred: ModuleNotFoundError No module named 'influxdb'".

from influxdb import InfluxDBClient

enter image description here

I've already checked whether I installed the package or not, but still not worked.

enter image description here

Any help would be appreciated, thanks!

melwil
  • 2,547
  • 1
  • 19
  • 34
  • Is your VSCode installation (not only the terminal within) aware of the `backend` venv you installed your requirement into? – YoshiMbele Jun 14 '23 at 06:30

1 Answers1

0

Make sure you have selected the 'backend' venv in VSCode as well, otherwise it'll be validating your code with the global Python packages.

You have a shortcut for it in the lower right-corner (in my case the venv is called 'venv' and contains a Python 3.10.10 as opposed to the global Python 3.11). Example below

VS Code Python environment selector

Antra
  • 16
  • 4