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

mila code <script dir> results in FileNotFoundError for 'code' folder #7

Closed
semihcanturk opened this issue Nov 5, 2021 · 2 comments

Comments

@semihcanturk
Copy link

So the mila code path/to/my/experiment command seems to be not working correctly, or I'm doing something wrong. What would be the appropriate way of running a python script that's in $HOME/GTaxoGym/main.py?

(local) $ code --remote ssh-remote+kepler4.server.mila.quebec /home/mila/s/semih.canturk/GTaxoGym/main.py
Traceback (most recent call last):
  File "/usr/local/bin/mila", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/milatools/commands.py", line 14, in main
    auto_cli(milatools)
  File "/usr/local/lib/python3.8/site-packages/coleo/cli.py", line 613, in auto_cli
    result = run_cli(entry, args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/coleo/cli.py", line 585, in run_cli
    return call(opts=opts, args=args)
  File "/usr/local/lib/python3.8/site-packages/coleo/cli.py", line 544, in thunk
    result = fn(*args)
  File "/usr/local/lib/python3.8/site-packages/ptera/core.py", line 853, in __call__
    rval = super().__call__(*self.partial_args, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/ptera/selfless.py", line 656, in __call__
    return self.fn(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/milatools/commands.py", line 192, in code
    here.run("code", "--remote", f"ssh-remote+{node_name}.server.mila.quebec", path)
  File "/usr/local/lib/python3.8/site-packages/milatools/utils.py", line 29, in run
    return subprocess.run(
  File "/usr/local/Cellar/python@3.8/3.8.11/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/local/Cellar/python@3.8/3.8.11/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Cellar/python@3.8/3.8.11/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'code'
semo@Semihs-MacBook-Pro ~ % 
@breuleux
Copy link
Member

breuleux commented Nov 6, 2021

That is probably because you haven't installed the code command in your PATH. Does it work if you just try to run code in the terminal? If not, hit Cmd+Shift+P in VSCode and type "shell install", this should show you a command to add code to your PATH. Select that, then close and reopen your terminal session and try again, I believe it should work.

Also, relative paths are understood to be relative to your home, so you can write GTaxoGym/main.py instead of /home/mila/s/semih.canturk/GTaxoGym/main.py.

@semihcanturk
Copy link
Author

That was indeed the case. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants