If you are using jupyter notebook online for example on google colab, then you need to specify the path within the to_csv parameters example:
to_csv
df.to_csv('sample_data/myCSV.csv')