ElixirSublime icon indicating copy to clipboard operation
ElixirSublime copied to clipboard

FileNotFoundError: [Errno 2] No such file or directory: 'mix'

Open samsondav opened this issue 9 years ago • 5 comments

I see this in the console:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 210, in on_api_ready
    m.plugin_loaded()
  File "/Users/sam/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 17, in plugin_loaded
    run_mix_task('deps.get')
  File "/Users/sam/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 65, in run_mix_task
    startupinfo=startupinfo)
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1448, in _execute_child

FileNotFoundError: [Errno 2] No such file or directory: 'mix'

samsondav avatar Apr 15 '17 21:04 samsondav

Same issue here

thiagolocatelli avatar Apr 18 '17 23:04 thiagolocatelli

See https://github.com/vishnevskiy/ElixirSublime/issues/22#issuecomment-213393356

but use the path /usr/local/bin

nhooyr avatar May 09 '17 22:05 nhooyr

If anyone facing same issue, its possible that elixir may not be in PATH loaded my sublime (App not loading shell env). Try starting sublime from shell where elixir is working and follow #22 (comment). You will have to start sublime from shell every time.

gouthamvel avatar Jan 23 '18 20:01 gouthamvel

This issue happens when sublime is not launched from the terminal, so it is not aware of the PATH variable set by Bash or other terminal.

After so many hours spent I came with a really simple solution if all you need is to set the PATH manually. Create a plugin that will update PATH. https://robdodson.me/hacking-the-path-variable-in-sublime-text/

# https://robdodson.me/hacking-the-path-variable-in-sublime-text/
# If you are using Linux, save this plugin in ~/.config/sublime-text-3/Packages/User/Pathway.py
import os
  
# Sublime's default path is
# /usr/bin:/bin:/usr/sbin:/sbin
os.environ['PATH'] += ':'
os.environ['PATH'] += '/home/USERNAME/.asdf/shims:'
os.environ['PATH'] += '/home/USERNAME/.asdf/bin:'

print('PATH = ' + os.environ['PATH'])

Open up the console window to see and you will see "PATH = " with your env variable.

eksperimental avatar Sep 19 '20 22:09 eksperimental

If you're on Linux and installed Elixir with asdf, try to create a symbolic link under /usr/bin/ to shim files usually on /home/your_user/.asdf/shims/mix

try: sudo ln -s /home/your_user/.asdf/shims/mix /usr/bin/mix

diogoca avatar Nov 06 '20 18:11 diogoca