i am having this issue since like 2 months, it didnt bother me at first but now that im trying to import a file with pd or even a normal txt file with open() it gives me this Exception:
File "C:\Users\lcc_zarkos\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\io\common.py", line 642, in get_handle
handle = open(
FileNotFoundError: [Errno 2] No such file or directory: 'marketing.xlsx'
if i use the full path it just runs normally. people would say "just use full path then" but this is a really bad solution when it comes to using this program on multiple devices with different paths or stuff like that so i hope you have any solutions. here is the code:
import pandas as pd
df = pd.read_csv('marketing.xlsx')
edit: it has none to do with the code itself but more like windows or my pc
os.getcwd()andos.listdir()to see if you're actually executing in the path you expect, and the file is present according to the interpreter..xlsxfilename extension indicates that that's an Excel workbook. CSV (comma-separated-values) means a delimited text file. An Excel workbook is a different beast.read_csv('marketing.xlsx')os.listdir()returns['main.py', 'marketing .xlsx', 'requirements.txt', 'setup.py']os.listdiroutput you posted has a space aftermarketing, is that a typo ?