I know that this issue has been raised in other posts... But I could not find a way to solve my issues reading them.
I am trying to open a ".txt" file using pandas on Eclipse/PyDev.
import pandas as pd
filePath = "/PathToFile/Test.txt" #This is only an example, clearly...
df1 = pd.read_csv(filePath, sep = "\t", header = 0, index_col = 0)
print(df1)
I get the following Error:
File "pandas/_libs/parsers.pyx", line 374, in pandas._libs.parsers.TextReader.cinit File "pandas/_libs/parsers.pyx", line 678, in pandas._libs.parsers.TextReader._setup_parser_source OSError: Initializing from file failed
This function has worked properly for me on the same machine in JuPyter Notebooks and in another IDE (Spyder). But not in Eclipse. JuPyter notebook and Spyder can open the identical file without any problem executing the exact lines of code I've written above...
Following some suggestions on similar posts I tried to add the argument "engine = "python"":
import pandas as pd
filePath = "/PathToFile/Test.txt"
df1 = pd.read_csv(filePath, sep = "\t", header = 0, index_col = 0, engine = "python")
print(df1)
I get another Error:
PermissionError: [Errno 1] Operation not permitted: '/PathToFile/Test.txt'
Following some other suggestion, I've checked the file permission... but even if I set all the possible file permission on the file, I still get the same error...
I thought it could be a problem of Eclipse running with a different Python Interpreter than JuPyter and Sypder. I tried all the interpreters I have (different Conda environments) and the same one that I used with JuPyter and with Spyder. Still, I get the same Errors.
It must be some issue specifically related to Eclipse. In the past Eclipse worked fine also for this task... What is wrong now?
Thanks for the help in advance!