0

I use Visual Studio to run a single python file. This is not a project, just a single file. As usual everything works fine, but when i try utilize another file it will not be found.

enter image description here

I get FileNotFoundError: [Errno 2] No such file or directory: 'data.xlsx'

I run python files using "Execute in Python Interactive button"

enter image description here

Everything works great when I run Start without debugging.

enter image description here

It executes as expected

enter image description here

DeepSpace
  • 153
  • 1
  • 2
  • 11
  • Are you actually in a project in Visual Studio (even if this very file is not)? That could mean that the working directory is the root of the project and not your directory `matplotlib` where the script and excel file is. (And therefore is looking for the file in the wrong directory) – LinFelix Jun 07 '19 at 10:46
  • Everything works great when I run Start without debugging. – DeepSpace Jun 07 '19 at 11:08
  • Which version of `Visual Studio` are you running? This seems to be a more visual-studio related problem than a python trying to find a file one. For comparison https://stackoverflow.com/questions/27582683/python-in-visual-studio-ptvs-debug-not-working-but-run-works – LinFelix Jun 13 '19 at 08:57

0 Answers0