Skip to content

FileNotFoundError: No such file or directory: '/usr/local/bin/limactl' #24

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

Closed
buzzsurfr opened this issue Oct 9, 2021 · 6 comments · Fixed by #25
Closed

FileNotFoundError: No such file or directory: '/usr/local/bin/limactl' #24

buzzsurfr opened this issue Oct 9, 2021 · 6 comments · Fixed by #25

Comments

@buzzsurfr
Copy link

I'm getting the following error in xbar:

 [2021-10-09 09:05:07,468][    INFO][lima-plugin:543 -                 main() ] argv[0] ./lima-plugin
🐋 🏃 | color=#29cc00
---
Traceback (most recent call last):
  File "/Users/salvot/Library/Application Support/xbar/plugins/./lima-plugin", line 567, in <module>
    main()
  File "/Users/salvot/Library/Application Support/xbar/plugins/./lima-plugin", line 545, in main
    xbarMenu()
  File "/Users/salvot/Library/Application Support/xbar/plugins/./lima-plugin", line 526, in xbarMenu
    aboutMenu()
  File "/Users/salvot/Library/Application Support/xbar/plugins/./lima-plugin", line 418, in aboutMenu
    limaVersion = subprocess.run(
  File "/opt/homebrew/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/opt/homebrew/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/homebrew/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/limactl'

I've tried a few permutations of adding /usr/local/bin and /opt/homebrew/bin to the command, as well as checking environment variables.

Ultimately, I had to symlink lima and limactl into /usr/local/bin. Is this expected, and should this be part of the Makefile?

@unixorn
Copy link
Owner

unixorn commented Oct 9, 2021

This is unexpected. Where are lima and limactl installed on your machine? I can update the path-updater to add more directories when they're present.

@buzzsurfr
Copy link
Author

I used homebrew to install, so they’re in /opt/homebrew/bin. What’s odd is those are also in my PATH environment variable.

@unixorn
Copy link
Owner

unixorn commented Oct 10, 2021

Annoyingly gui apps don't inherit your PATH from .zshrc/.bashrc

I'll make prep_environment_for_lima also add /opt/homebrew/bin to $PATH, thanks for letting me know.

unixorn added a commit that referenced this issue Oct 10, 2021
`brew` doesn't always use `/usr/local/bin` any more, and the GUI menubar
app doesn't inherit `$PATH` from `.zshrc`/`.bashrc` which caused
problems.

We now add a list of potential directories to `$PATH` if they exist and
are directories.

Closes #24

Signed-off-by: Joe Block <[email protected]>
unixorn added a commit that referenced this issue Oct 10, 2021
`brew` doesn't always use `/usr/local/bin` any more, and macOS
doesn't pass the `$PATH` from `.zshrc`/`.bashrc` to GUI applications
which caused problems with a `brew`-installed version of `lima`.

We now add a list of potential directories to `$PATH` if they exist
and are directories.

Closes #24

Signed-off-by: Joe Block <[email protected]>
@unixorn
Copy link
Owner

unixorn commented Oct 10, 2021

Out of curiosity, are you running on an ARM Mac? My Intel MBP installed brew in /usr/local/bin.

unixorn added a commit that referenced this issue Oct 10, 2021
`brew` doesn't always use `/usr/local/bin` any more, and macOS
doesn't pass the `$PATH` from `.zshrc`/`.bashrc` to GUI applications
which caused problems with a `brew`-installed version of `lima`.

We now add a list of potential directories to `$PATH` if they exist
and are directories.

We also look for `/opt/local/bin` to handle macports.

Closes #24

Signed-off-by: Joe Block <[email protected]>
unixorn added a commit that referenced this issue Oct 10, 2021
`brew` doesn't always use `/usr/local/bin` any more, and macOS
doesn't pass the `$PATH` from `.zshrc`/`.bashrc` to GUI applications
which caused problems with a `brew`-installed version of `lima`.

`prep_environment_for_lima()` now adds a list of potential directories
to `$PATH` if they exist and are directories - currently `/usr/local/bin`,
`/opt/homebrew/bin` and `/opt/local/bin`.

Closes #24
Signed-off-by: Joe Block <[email protected]>
@buzzsurfr
Copy link
Author

Yes I am. It also is a corporate MacBook but we don't tend to mess with defaults too much.

@unixorn
Copy link
Owner

unixorn commented Oct 11, 2021

Let me know if you still have issues - #25 should have fixed the issue with /opt/homebrew/bin (and as a bonus, macports' /opt/local/bin).

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

Successfully merging a pull request may close this issue.

2 participants