0

When debugging, this works ok, but when running without debugging, I get the error. I tested with one line: import fiona

Traceback (most recent call last):
  File "d:\own\fionatest.py", line 1, in <module>
    import fiona
ModuleNotFoundError: No module named 'fiona'

Fiona functions also work ok, when debugging, but for simplicity, I explain the situation with this one line. I can run the same script from windows command prompt normally without errors.

peke-tsu
  • 51
  • 5

1 Answers1

0

As explained here, debugging has specific settings on a launch file, and when in this mode the access to variables and paths might be changed as compared to the Run Python File in terminal option (which is what the arrow button does).

Therefore, I would assume that your module is not properly installed to be used in the environment you are trying to run the script. It might be helpful to know your Operational System and how someone can reproduce this behavior (as indicated in this link).

What to try

Uninstalling the module and reinstalling it, then restarting all the instances of VSCode and trying again, both the debugging and the arrow button. If the same behavior persists, probably you need to check the Python Path variables and which interpreter VSCode is using to run the Python scripts, and make sure it is the same used as reference for installing new modules.

Also, this answer might help shed a light to your situation.

MatBBastos
  • 401
  • 4
  • 14