Need explanation of this error
Hi, I'm new to Python and trying to run a already written code. Can someone please explain the error below? And if possible, how do I resolve this? Traceback (most recent call last): File "c:\Project_1\regression_1.py", line 7, in from sklearn import metrics, cross_validation, linear_model File "c:\Python27\lib\site-packages\sklearn\metrics\__init__.py", line 31, in from . import cluster File "c:\Python27\lib\site-packages\sklearn\metrics\cluster\__init__.py", line 8, in from .supervised import adjusted_mutual_info_score File "c:\Python27\lib\site-packages\sklearn\metrics\cluster\supervised.py", li ne 19, in from .expected_mutual_info_fast import expected_mutual_information File "expected_mutual_info_fast.pyx", line 10, in init sklearn.metrics.cluster .expected_mutual_info_fast (sklearn\metrics\cluster\expected_mutual_info_fast.c: 4886) File "c:\Python27\lib\site-packages\scipy\special\__init__.py", line 529, in < module> from ._ufuncs import * ImportError: DLL load failed: The specified module could not be found. -- http://mail.python.org/mailman/listinfo/python-list
Re: Need explanation of this error
Thanks! Solved. I found the package that would resolve this dependency. It was numpy-MKL. Downloaded from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pandas -- http://mail.python.org/mailman/listinfo/python-list
File exists but Python says 'not found'.
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: File exists but Python says 'not found'.
The variable 'train' is being called like this -> def main(train='train.csv', test='test.csv', submit='logistic_pred.csv'): print "Reading dataset..." train_data = pd.read_csv(train) test_data = pd.read_csv(test) Let me know if I need to post the full code. -- http://mail.python.org/mailman/listinfo/python-list
Re: File exists but Python says 'not found'.
I got it. The working directory was different. Sorry, I'm new and didn't the working directory has to be the location of the data. I thought the location of .py file and data file should be same. Thanks! Es. Robert Kern. -- http://mail.python.org/mailman/listinfo/python-list
Re: File exists but Python says 'not found'.
My answers I think Robert wanted to know how you started the program. What instruction do you use to launch? - used command c:\python27\python.exe c:\project_1\code.py In what directory are you launching your program? - working directory was c: - python is in c:\python27 - code was in c:\project_1 - changed the working directory to c:\project_1 now and it worked Is that the same directory where train.csv is present? - train.csv is present in c:\project_1 -- http://mail.python.org/mailman/listinfo/python-list
Re: File exists but Python says 'not found'.
I know. Had I written the code, I would have not done this. I just wanted to get some initial results by leveraging this code. I would now build on this to improve my work's accuracy. Thanks for the inputs! -- http://mail.python.org/mailman/listinfo/python-list
