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
Error while executing "python setup.py" in CLI : FileNotFoundError: [WinError 2] The system cannot find the file specified #1
Comments
Thanks for the feedback; didn't run into that issue on any of my test installs but just applied a fix that should prevent it in the future! |
>> Testing the latest version of the code with a fresh Anaconda environmentSame result :
Test : Failed ❌>> I put a print statement just before the exception was raised so I can see what was the final inputs before the crash :
>> My new guess :Anaconda does not recommend adding itself to system PATH anymore and does not offer the option to do it automatically so you have to do it manually. If you have a new installation and you follow the installation recommendations as I did, conda won't be accessible outside an Anaconda shell : So when calling "subprocess.run()" without the "shell=True" argument... a new command prompt is spawned, and calling "conda install -y pandas pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch" won't work because, "conda" can't be found in system PATH. It works with "shell=True" because it uses the "current" open shell which for me... is the Anaconda shell with the correct "env" activated >> Testing my new hypothesis :
result :
Test : Passed ✔>> Suggestion :Considering that adding the "shell=True" argument to "subprocess.run()" is considered a security flaw because it is vulnerable to shell injection. My only recommendation would be to add, in the "Requirements section", that Anaconda must be in the system PATH before running "setup.py" otherwise... all new Anaconda installations like mine are doomed to fail. |
Wow, that's for the very detailed write-up! I can't reproduce this on my end, but I can add a command-line switch to enable shell=True. I'll check for FileNotFoundError and display some text explaining that it can be enabled if the user wants. Will re-open this until I have a minute to make the change. |
Just wanted to add a note that I also encountered this issue on Windows. Thanks for the solution! |
Finally got around to handling this (hopefully - my installations work without the shell option so I can't do a perfect test). Added a FileNotFoundError check and prompt the user to re-run setup with a new --shell option, which should allow the installation to work in environments that require shell=true. |
>> Testing the latest version of the code with a fresh Anaconda environment, in a VM, with the defaults Anaconda installation options :Testing that the error is still present in the default install :
The error is still present 🚧>> Testing the new "--shell" flag :
Test : Failed ❌The solution :The "shell" parameter is not used when calling "install_pytorch()" function, in "setup.py".
- Line 55 exec(cmd, verbose)
+ Line 55 exec(cmd, verbose, shell) >> Testing the new solution :
Test : Passed ✔To-do:
Thank you ! 😄 |
That's what I get for committing without testing! 😄 Should be fixed now - appreciate the help! |
>> Final test of the latest version of the code, in a VM. Defaults Anaconda installation options. [Closing this issue] :Testing that the error is still present in the default install :
The error is still present 🚧>> Testing "--shell" flag :
Test : Passed ✔Final note :Great job @rbbrdckybk !! 💪🍺🏆 |
When did the bug happened :
What OS was affected :
The solution :
Where did I find the solution :
Final Note :
The text was updated successfully, but these errors were encountered: