Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:not': 0.03; 'received:134': 0.05; 'subject:Python': 0.06; 'parser': 0.07; '**kwds)': 0.16; '.py': 0.16; 'csv': 0.16; 'exist.': 0.16; 'ioerror:': 0.16; "subject:'.": 0.16; 'subject:File': 0.16; 'subject:exists': 0.16; 'trying': 0.19; 'skip:p 40': 0.19; 'saying': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'exists': 0.24; 'file.': 0.24; 'skip:" 30': 0.26; 'skip:_ 20': 0.27; 'header:In-Reply-To:1': 0.27; 'skip:p 30': 0.29; 'points': 0.29; "doesn't": 0.30; 'skip:( 20': 0.30; "i'm": 0.30; 'gives': 0.31; 'code': 0.31; 'symbolic': 0.31; 'file': 0.32; 'this.': 0.32; 'thanks!': 0.32; 'open': 0.33; 'running': 0.33; '(most': 0.33; 'guess': 0.33; 'skip:s 30': 0.35; 'but': 0.35; 'skip:" 50': 0.36; 'entry': 0.36; 'to:addr:python-list': 0.38; 'files': 0.38; 'recent': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'skip:t 30': 0.61; 'skip:* 10': 0.61; 'email addr:gmail.com': 0.63; 'reads': 0.68; 'fail.': 0.84; 'pardon': 0.84; 'subject:found': 0.93 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap8EAN1f0VGGuA9G/2dsb2JhbABagzu/YYEUgxgBBSdREQshFg8JAwIBAgEPNhMGAgKHeQMPsm8NS4gHjHWCcBaDUQOVYYFngSmEZYYShSWDEw Date: Mon, 01 Jul 2013 12:59:53 +0200 From: Antoon Pardon User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: python-list@python.org Subject: Re: File exists but Python says 'not found'. References: <5c1d1e47-b67e-4bce-8601-b14c0215f450@googlegroups.com> In-Reply-To: <5c1d1e47-b67e-4bce-8601-b14c0215f450@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372676395 news.xs4all.nl 15978 [2001:888:2000:d::a6]:53896 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49547 Op 01-07-13 12:47, prerit86@gmail.com schreef: > I'm running this code that reads 2 csv files (one of them is train.csv). The code gives an error saying 'file not does not exist'. However, the file does exists in the same location as the .py file. Can someone please help me on this. Thanks! > > Code Output--> > > Reading dataset... > Traceback (most recent call last): > File "c:\Project_1\regression_2.py", line 163, in > main(**args) > File "c:\Project_1\regression_2.py", line 80, in main > train_data = pd.read_csv(train) > File "c:\Python27\lib\site-packages\pandas\io\parsers.py", line 401, in parser > _f > return _read(filepath_or_buffer, kwds) > File "c:\Python27\lib\site-packages\pandas\io\parsers.py", line 209, in _read > parser = TextFileReader(filepath_or_buffer, **kwds) > File "c:\Python27\lib\site-packages\pandas\io\parsers.py", line 509, in __init > __ > self._make_engine(self.engine) > File "c:\Python27\lib\site-packages\pandas\io\parsers.py", line 611, in _make_ > engine > self._engine = CParserWrapper(self.f, **self.options) > File "c:\Python27\lib\site-packages\pandas\io\parsers.py", line 893, in __init > __ > self._reader = _parser.TextReader(src, **kwds) > File "parser.pyx", line 312, in pandas._parser.TextReader.__cinit__ (pandas\sr > c\parser.c:2846) > File "parser.pyx", line 512, in pandas._parser.TextReader._setup_parser_source > (pandas\src\parser.c:4893) > IOError: File train.csv does not exist My guess is that train.csv is a symbolic link that points to a file that doesn't exist. So looking at your directory you can see an entry but actualy trying to open it will fail. -- Antoon Pardon