adampresley / sublime-view-in-browser

Open the contents of your current view/tab in a web browser
MIT License
271 stars 67 forks source link

FileNotFoundError: [WinError 2] The system cannot find the file specified #79

Open N1GHTR4NG3R opened 6 years ago

N1GHTR4NG3R commented 6 years ago

I keep getting this error and cannot figure out how to resolve it.

View In Browser plugin v2.0.0, Python 3 C:\Program Files (x86)\Mozilla Firefox\firefox.exe -new-tab file:///c:/users/r_bal/appdata/local/temp/tmp2x386a.htm Traceback (most recent call last): File "./python3.3/subprocess.py", line 1104, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "F:\Code Editors\Sublime Text 3\sublimeplugin.py", line 818, in run return self.run(edit) File "ViewInBrowserCommand in C:\Users\R_Bal\AppData\Roaming\Sublime Text 3\Installed Packages\View In Browser.sublime-package", line 238, in run File "ViewInBrowserCommand in C:\Users\R_Bal\AppData\Roaming\Sublime Text 3\Installed Packages\View In Browser.sublime-package", line 191, in openBrowser File "./python3.3/subprocess.py", line 819, in init File "./python3.3/subprocess.py", line 1110, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified

If it helps, I have followed the installation guide on your wiki page and also searched google for resolutions. It appears that it is not using my user settings and only the default settings. which as a note the only line I changed was for the firefox install directory on line 25 of the default sheet to this:

"firefox": "C:\Program Files\Mozilla Firefox\firefox.exe -new-tab",

I took out the (x86) by program files to find my default install directory - yet it seems to revert back to the default and not attempt to use the "user" defined settings.

nclow commented 5 years ago

Given the nt/win32 key it appears the plugin makes no attempt to understand where 64-bit browser installations are on a Windows system. The workaround is to update the win32 path for your browser to actually point to the correct directory

Preferences -> Package Settings -> View In Browser -> Settings - User

{
    "nt": {
        "win32": {
            "firefox": "C:\\Program Files\\Mozilla Firefox\\firefox.exe -new-tab"
        }
    },
    "browser": "firefox"
}

Update as appropriate by removing the (x86) from the path of the browser of your choice. This plugin appears abandoned so I wouldn't expect a fix from the author anytime soon.