Whenever I try to run a program in VisualStudio in python that involves the simple procedure of opening a file and reading it, or creating a DataFrame with pd.pandas I come across the following error:
FileNotFoundError: [Errno 2] No such file or directory: 'file-name.csv'
I have already checked several different paths, like trying to connect VS with the conda virtual environment (I use python through the Anaconda package) through different paths - either launching the application from within anaconda navigator or through command lines in the internal terminal, and in all cases encounter the same error.
A very simple example of code that I tried to run was the following, which opens a file with a .json extension and converts it to a .csv file using pandas:
import pandas as pd
dataframe = pd.read_json('original-file-name.json', lines = True)
dataframe.to_csv('converted-file.csv', index=False, encoding='utf-8')
I believe that it is some foolishness of mine regarding the functioning of VS Code, since when running the same code mentioned above in another IDE, such as Spyder, the same works.
I appreciate any kind of help or guidance! thanks in advance