0

I have configured Sublime Text 3 to build a python script from my installation of the Anaconda3 distribution. I have a 'hello world' python script that prints successfully. The default python build system also works.

However, when I try to run a gui script compiled from qtdesigner, the gui is not displayed, and no error is provided. I think it is just suppressing the gui, but I can't figure out how to force it (or configure it) to do so.

If I build the the default Python default system the gui displays -- so there must be some setting I can set to disable this windows gui suppression when using the Anaconda3 build system. Below is the Anaconda3.sublime-build json file used:

{
"cmd": ["C:\\ProgramData\\Anaconda3\\python","-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

I'm working on a PC, running Windows 10 with the latest install of Anaconda3 and Sublime Text 3.

Thanks for the help.

jrive
  • 218
  • 2
  • 3
  • 14

1 Answers1

1
{
    "cmd": ["start", "cmd", "/k", "C:\\ProgramData\\Anaconda3\\python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

This may do the trick. It starts the python process in an external cmd window, running your program from the command line instead of inside Sublime.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • thank you for your suggestion. I get the following error: "[WinError 2] The system cannot find the file specified" – jrive Oct 07 '20 at 17:16
  • @jrive OK, I'm a little confused. Was your original Anaconda build system working with the `C:\\ProgramData\\Anaconda3\\python` path? What happens if you change `python` to `python3`? – MattDMo Oct 07 '20 at 17:26
  • I got it to work, but I couldn't tell you exactly what I did. It is python...that is the executable in the Anaconda3 root directory. My installation of Sublime puts the user settings in AppData\Roaming\.....I'm not sure why ; I installed it for all users as the administrator. Anyway, I may have been updating the wrong Sublime-build file.....Also, another thing that I had to do was that once the Conda package was installed, I had to "enable it with Conda:Enable.....I must say, installing these environments is more difficult than any code I'd ever write! (Especially for a HW guy). Thanks! – jrive Oct 08 '20 at 01:08