"[Errno 2] No such file or directory" running gsutil
See original GitHub issueI’m trying to get the dart-sdk checked out and working on my MacBook, but when I run gclient sync
I’m greeted with the error:
[Errno 2] No such file or directory
Full details are here but I’ve managed to get as far as discovering that even gsutil.py version -l
from inside the depot_tools
folder doesn’t work:
dantup-macbookpro:depot_tools dantup$ gsutil.py version -l
Traceback (most recent call last):
File "/Users/dantup/Dev/Google/depot_tools/gsutil.py", line 183, in <module>
sys.exit(main())
File "/Users/dantup/Dev/Google/depot_tools/gsutil.py", line 180, in main
clean=args.clean)
File "/Users/dantup/Dev/Google/depot_tools/gsutil.py", line 152, in run_gsutil
return subprocess.call(cmd, shell=IS_WINDOWS)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
If I open up line 152 of gsutil.py
and add print cmd
just before it tries to run the command, I get this output:
[‘vpython’, ‘-vpython-spec’, ‘/Users/dantup/Dev/Google/depot_tools/gsutil.vpython’, ‘–’, ‘/Users/dantup/Dev/Google/depot_tools/external_bin/gsutil/gsutil_4.30/gsutil/gsutil’, ‘-o’, ‘GSUtil:software_update_check_period=0’, ‘version’, ‘-l’]
If I try to run that command manually from the terminal, it works fine:
dantup-macbookpro:depot_tools dantup$ vpython -vpython-spec /Users/dantup/Dev/Google/depot_tools/gsutil.vpython -- /Users/dantup/Dev/Google/depot_tools/external_bin/gsutil/gsutil_4.28/gsutil/gsutil -o GSUtil:software_update_check_period=0 version
gsutil version: 4.28
I’ve hit this on three machines - previously on my Windows PC and my personal MacBook - I kinda gave up since the checkout had worked well enough for what I needed, but now I’m hitting the same issue on my Google corp MacBook and I’m really hoping to fix it this time!
Any ideas on how to troubleshoot further?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
In case anyone else finds this post with a similar issue, it turned out to be fairly simple - I’d used tildes
~
in my PATH, and they resolved fine in the terminal but not inside Python, which is why it culdn’t findvpython
. Doh.Maybe the environment from which you’re running the command isn’t able to run vpython – try editing cmd to use the full path to vpython, maybe? Regardless, this isn’t related to gsutil itself; it’s a problem with the tool that attempts to bundle and run it. I’d recommend continuing investigation on the other issue you linked.