Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: [WinError 2] The system cannot find the file specified #13

Open
sametdumankaya opened this issue Mar 27, 2019 · 20 comments
Labels
bug Something isn't working

Comments

@sametdumankaya
Copy link

sametdumankaya commented Mar 27, 2019

When I try to run the jupyter notebook that you provided on the link
https://github.com/minimaxir/automl-gs/blob/master/docs/automl_gs_tutorial.ipynb
I'm getting FileNotFoundError. Also, when I tried with a local csv file, I got the same error again.
Btw, my OS is Windows 10.

image

@vjohansen
Copy link

same here

It seems to call "python model.py .. "

printing cmd

call Popen with cmd: ['python3', 'model.py', '-d', 'c:\\temp\\x.csv', '-m', 'train', '-c', 'automl-gs']

and then fails possibly due to a missing model.pu

@sametdumankaya
Copy link
Author

Yeah, probably. I added the shell=True argument to the Popen statement to see if it works, but it generated another FileNotFoundError.

@minimaxir
Copy link
Owner

Yes, I admit I did not test on Windows. I thought having os.path everywhere would be enough, but I suppose it's true the subprocess on Windows is a bit different, or the file path of the generated files is not correct.

Will try to look into.

@minimaxir minimaxir added the bug Something isn't working label Mar 27, 2019
@artu001
Copy link

artu001 commented Mar 27, 2019

same questions,in window system,

@drsteveoh
Copy link

Same here. Not a permissions issue, definitely seems like an issue with the path of the created model.py file (maybe?).

evan-burke added a commit to evan-burke/automl-gs that referenced this issue Apr 1, 2019
@evan-burke
Copy link
Contributor

It's actually the python executable. Subprocess doesn't appear to check the PATH, per https://stackoverflow.com/a/32799942/2540707

@minimaxir
Copy link
Owner

I'm OK with using shell=True or another approach like what the referenced commit does with shutil.

@artu001
Copy link

artu001 commented Apr 2, 2019

@minimaxir bug is closed?

@VinayChaudhari1996
Copy link

I also have same issue


does anyone try google colab with TPU ?
automl_grid_search('train.csv','Survived',framework='tensorflow')
Solving a binary_classification problem, maximizing accuracy using tensorflow.

Modeling with field specifications:
PassengerId: numeric
Pclass: categorical
Name: ignore
Sex: categorical
Age: numeric
SibSp: categorical
Parch: categorical
Ticket: ignore
Fare: numeric
Cabin: categorical
Embarked: categorical



HBox(children=(IntProgress(value=0), HTML(value='')))



HBox(children=(IntProgress(value=0, max=20), HTML(value='')))



---------------------------------------------------------------------------

FileNotFoundError                         Traceback (most recent call last)

<ipython-input-15-2a49bf52604c> in <module>
----> 1 automl_grid_search('train.csv','Survived',framework='tensorflow')


~\Anaconda3\lib\site-packages\automl_gs\automl_gs.py in automl_grid_search(csv_path, target_field, target_metric, framework, model_name, context, num_trials, split, num_epochs, col_types, gpu, tpu_address)
     80 
     81         # Execute model training using the generated files.
---> 82         train_generated_model(cmd, num_epochs, train_folder, pbar_sub)
     83 
     84         # Load the training results from the generated CSV,


~\Anaconda3\lib\site-packages\automl_gs\utils_automl.py in train_generated_model(cmd, num_epochs, train_folder, pbar_sub)
    310 
    311     p = Popen(cmd, cwd=train_folder, stdout=PIPE, bufsize=1,
--> 312               universal_newlines=True) 
    313 
    314     for line in iter(p.stdout.readline, ""):


~\Anaconda3\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
    727                                 c2pread, c2pwrite,
    728                                 errread, errwrite,
--> 729                                 restore_signals, start_new_session)
    730         except:
    731             # Cleanup if the child failed starting.


~\Anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
   1015                                          env,
   1016                                          os.fspath(cwd) if cwd is not None else None,
-> 1017                                          startupinfo)
   1018             finally:
   1019                 # Child is launched. Close the parent's copy of those pipe


FileNotFoundError: [WinError 2] The system cannot find the file specified

@minimaxir
Copy link
Owner

This should be fixed in 0.2.1. Upgrade and let me know if it works!

@minimaxir minimaxir reopened this Apr 5, 2019
@minimaxir
Copy link
Owner

Also I have no idea how you would get a WinError on a TPU when TPUs do not work on Win. That may be fixed by 0.2.1 as well.

@plartoo
Copy link

plartoo commented May 6, 2019

@minimaxir I upgraded automl-gs to 0.2.1, but the issue still persists. I am testing it on Windows 10, and I think the problem is here. There, the code is trying to read 'results.csv', but it hasn't written anything before. I hope this will help you troubleshoot (e.g., you delete 'results.csv' file in your development folder/workspace and see if automl_gs still works) so that it will help us who want to give this library a try. Thank you.

@bluetyson
Copy link

I installed this morning and the same results.csv error exists (Windows 10).

@evan-burke
Copy link
Contributor

Tip: this may be happening because the training subprocess is crashing; if so, Jupyter/ipython/colab won't show exceptions from that because it's being run in a separate process.

If you run automl_gs on the command line, you should see the exception from the model.py subprocess (in addition to this exception), which might give you more insight into what's breaking.

@bluetyson
Copy link

The Jupyter Notebook also adds this, as far as errors go :- FileNotFoundError: [Errno 2] No such file or directory: 'encoders\pclass_encoder.json'

It does appear to be running from the [minconda] command line however, at least a basic trial.

@Benischeck
Copy link

Any updates on this issue? Also running into problems with it.

@ritik0525
Copy link

FileNotFoundError Traceback (most recent call last)
in
----> 1 import pandas as pd

~\pandas.py in
9 import os
10
---> 11 os.chdir("F:/titanic")
12 df=pd.read_csv('train.csv')
13 #df.head(5)

FileNotFoundError: [WinError 2] The system cannot find the file specified: 'F:/titanic'
it take old file which I make early

@jetzhu
Copy link

jetzhu commented Jun 3, 2020

You may want to check if your system is blocking access to the folder you are trying to make venv. for windows 10, Windows Security is by default protecting user's document folder from being accessed and will block those access, you may want to open Windows Security -> Virus & threat protection -> Protection history to allow access to the folder you are making venv at.

@MeaningOfLights
Copy link

@ashish1396
Copy link

I was also getting the same error when I was running code in spyder. Then I checked and found that, ffmpeg is needed. When I installed it from code "conda install -c conda-forge ffmpeg" (for anaconda), my issue gets resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests