I am using Python 3 on Sublime Text 3 (win8.1 64bit). When I write some code and then build, if there is an error, the Windows PATH
is displayed as part of the error.
How do I remove the Windows PATH
on Sublime Text 3 output when there is an error?
I wont to remove ==> I want to erase.
sublime-build , and it will now be accessible in the build system menu. Select it, hit Ctrl B to build, and then hit Ctrl Shift B to run the resulting program. Or you can use a Build and Run option and call it by hitting Ctrl B , then selecting that option. I Am doing that.
Go to Preferences -> Browse Packages. Then click User and delete your build system.
sublime-build program is trying to execute python as a command, but it's not able to find it on the path, so Windows generates an error. If you add the appropriate path to python.exe to your PATH environment variable (and restart Sublime), that problem should go away.
Sublime Text is able to run build programs such as 'make', either when a key in pressed (F7 by default), or when a file is saved. The build system to use can be select from the Tools/Build System menu. If a project is open, the selected build system will be remembered for the project.
This behavior can be changed by commenting out four specific lines in Packages/Default/exec.py
, which is the system file that runs build systems by default.
First, you'll need to install PackageResourceViewer
from Package Control. Next, open the Command Palette with CtrlShiftP and type in prv
to bring up the PackageResourceViewer options. Select PackageResourceViewer: Open Resource
, then Default
, then exec.py
. You can now hit Esc to clear the Command Palette.
In the open file, scroll down to approximately line 212, looking specifically for this code block:
if "PATH" in merged_env:
self.debug_text += "[path: " + str(merged_env["PATH"]) + "]"
else:
self.debug_text += "[path: " + str(os.environ["PATH"]) + "]"
Select all 4 lines, then comment them out by hitting Ctrl/. Finally, hit CtrlS to save the file.
This will create a new Default
folder in your Packages
directory (the one opened by selecting Preferences -> Browse Packages...
) with exec.py
inside, and will override the original file stored in Default.sublime-package
, which is stored elsewhere, in Sublime's installation directory. If at any time you wish to have the full PATH
printed again, simply open Packages/Default/exec.py
and uncomment the lines you commented before, then save the file.
I would also recommend deleting exec.py
and re-running through the procedure above every time you upgrade Sublime, as there may be vital changes to this file in the new release that are key for other parts of the build systems to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With