Python: Import excel file using relative path
问题 I tried to import an excel file which is not within the same folder than the script. I need to get one folder above, then into another folder (B_folder) and there is file 2_file.xlsx I tried: df = pd.read_excel(r'..\B_folder\2_file.xlsx') and got: FileNotFoundError: [Errno 2] No such file or directory: '..\\B_folder\\2_file.xlsx' also tried: foreslash instead of backslash without the 'r' before path but I always get the error message above or this one: OSError: [Errno 22] Invalid argument: '.