Search code examples
pythonsublimetext3spyder

The same Python script no error in Spyder but error in Sublime Text


I am just running a very simple script. It is working in Spyder but not in Sublime Text, I am so confused:

import pandas as pd

iris_df = pd.read_csv("data/iris.data") 

Error in Sublime Text:

FileNotFoundError: [Errno 2] File b'data/iris.data' does not exist: b'data/iris.data'

Solution

  • In Spyder, it may set to current working directly., so specifying the file name would be enough to execute the code. Whereas when you run from sublime, Atom etc.., you need to specify the complete file path.