Initializing from file failed
See original GitHub issueKindly, share your insights regarding the following error
File "source\matrix_gen.py", line 68, in <module>
main()
File "source\matrix_gen.py", line 22, in main
data = pd.read_csv(sys.argv[1], parse_dates=True, dayfirst=True)# argv[1]: stock_symbol.txt
File "C:\Users\aims\Anaconda3\envs\py35\lib\site-packages\pandas\io\parsers.py", line 678, in parser_f
return _read(filepath_or_buffer, kwds)
File "C:\Users\aims\Anaconda3\envs\py35\lib\site-packages\pandas\io\parsers.py", line 440, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File "C:\Users\aims\Anaconda3\envs\py35\lib\site-packages\pandas\io\parsers.py", line 787, in __init__
self._make_engine(self.engine)
File "C:\Users\aims\Anaconda3\envs\py35\lib\site-packages\pandas\io\parsers.py", line 1014, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File "C:\Users\aims\Anaconda3\envs\py35\lib\site-packages\pandas\io\parsers.py", line 1708, in __init__
self._reader = parsers.TextReader(src, **kwds)
File "pandas\_libs\parsers.pyx", line 384, in pandas._libs.parsers.TextReader.__cinit__
File "pandas\_libs\parsers.pyx", line 697, in pandas._libs.parsers.TextReader._setup_parser_source
OSError: Initializing from file failed
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
OSError: Initializing from file failed on csv in Pandas
By this error Python indicates the file is not readable- either, file permission, file error, incorrect path. etc. My code giving this error...
Read more >OSError: Initializing from file failed on csv in Pandas - YouTube
Pandas : OSError: Initializing from file failed on csv in Pandas [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
Read more >I am getting an OS error and not sure why. - Kaggle
I am trying to read a CSV file using pandas read_csv function but I keep getting an OSerror. Here is the code. ......
Read more >Python – OSError: Initializing from file failed on csv in Pandas
So far pandas read through all my CSV files without any problem, however now there seems to be a problem.. When doing: df...
Read more >OSError: Initializing from file failed" when reading lots of docs ...
[Solved]-"OSError: Initializing from file failed" when reading lots of docs-Pandas,Python. Search. score:1. Accepted answer. Usually when I use glob I have ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into a similar issue with a Jupyter notebook downloaded from the internet with an accompanying CSV. Turned out the CSV had no read permissions–sigh–and Pandas didn’t give a hint as to that underlying cause. Not sure if this was the same thing happening to you @JafferWilson--I forget how permissions work on Windows–but figured I post this in case anyone else hits a similar issue.
txtPath = ‘E:/Defensive/textlog’ txtLists = os.listdir(txtPath) # txtLists = os.path.isdir(txtPath) for txt in txtLists: file_name = txtPath + “/” + txt reader = pd.read_table(file_name, sep=“,”, names=[i for i in range(4)], iterator=True)
error:OSError: Initializing from file failed
why?