Windows 10, WinError 2 / 5
Bloodmallet opened this issue · 3 comments
Hey,
I was looking around to fix WinError 2 and 5 when trying to add PyYapf to Sublime Text 3. But I don't get it to work. I've read that I need to use the full path and executable but that still doesn't seem to be enough.
My User settings:
{
"on_save": true,
"yapf_command": "C:/Users/special_name/AppData/Local/Programs/Python/Python36-32/python.exe C:/Users/special_name/AppData/Local/Programs/Python/Python36-32/Lib/site-packages/yapf"
}
^ WinError 2
To be fair I tried a lot of other solutions I found for other packages that got WinError 2 or 5. If I leave out the pythone executable path I get WinError 5.
{
"on_save": true,
"yapf_command": "C:/Users/special_name/AppData/Local/Programs/Python/Python36-32/Lib/site-packages/yapf"
}
^ WinError 5
You're specifying the module directory, not the path to the Yapf binary. In this case, you should probably use the first option but with a -m
inbetween the two paths, i.e. "PATH_TO_PYTHON -m PATH_TO_MODULE"
. Does that help?
Otherwise, try providing the path to the yapf
tool itself (which should be in the Bin
folder of your Python installation).
Oh my god, thank you very much. While -m
didn't work out (still got the WinError 2) I finally found the executable. In my installations are no bin
folders. My final input looks like this. Maybe it'll help others in the future who are as inexperienced with this as I am.
{
"yapf_command": "C:/Users/special_name/AppData/Local/Programs/Python/Python36-32/Scripts/yapf.exe"
}
Of course special_name
simply replaces my user name on this computer.
Again, thank you very much. It was awesome to get help this quickly!