mattiasnordin / StataEditor

Stata Editor for Sublime Text 3
47 stars 18 forks source link

Execution fails - Stata 15.1 and Windows 10 on laptop #37

Open justinsola opened 5 years ago

justinsola commented 5 years ago

Hi! So I have a confusing situation - code execution fails to open a new stata window and execute commands on my laptop, despite otherwise an otherwise identical configuration on desktop working great. I have reinstalled and faithfully executed the instructions several times (including both automated and manual variants of registering Stata). Here is my user settings file: StataEditor.zip

Highlighting works great, auto-completion of variables works, everything except any of the code execution commands. For example, when I press control-D when selecting some code I wish to execute, the cursor in ST appropriately shifts from the beginning to the end of the block.

Happy to supply more info / files if useful! And thanks so much for this - it's absolutely wonderful even when I copy-paste-execute instead of just executing!

Best, Justin

mattiasnordin commented 5 years ago

Hmm, I dont really know what the issue could be. One possibility is to experiment with the waiting time setting to see if that makes a difference. Other than that, what is written in the console when you execute code?

weidongzhou1994 commented 5 years ago

I also encounter this problem. When I install and use Stata Automation object, I find that Stata can't run.

flcong commented 4 years ago

Have you installed Pywin32 through Package Control?

justinsola commented 3 years ago

Sorry for the delay, I didn't have time to explore at that point. After a re-install of windows, stataeditor now longer works on my desktop computer as well. This time it's Stata IC version 16.1, all instructions followed (including using the SSC package sublime to try and automate setup). Console errors outputted in ST3 are as follows:

Traceback (most recent call last):
  File "C:\Users\justi\AppData\Roaming\Sublime Text 3\Installed Packages\StataEditor.sublime-package\StataEditorPlugin.py", line 63, in StataAutomate
AttributeError: 'module' object has no attribute 'stata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 1082, in run_
    return self.run(edit, **args)
  File "C:\Users\justi\AppData\Roaming\Sublime Text 3\Installed Packages\StataEditor.sublime-package\StataEditorPlugin.py", line 158, in run
  File "C:\Users\justi\AppData\Roaming\Sublime Text 3\Installed Packages\StataEditor.sublime-package\StataEditorPlugin.py", line 66, in StataAutomate
pywintypes.error: (2, 'WinExec', 'The system cannot find the file specified.')

Any insight? Thanks so much!

flcong commented 3 years ago

Sorry for the delay, I didn't have time to explore at that point. After a re-install of windows, stataeditor now longer works on my desktop computer as well. This time it's Stata IC version 16.1, all instructions followed (including using the SSC package sublime to try and automate setup). Console errors outputted in ST3 are as follows:

Traceback (most recent call last):
  File "C:\Users\justi\AppData\Roaming\Sublime Text 3\Installed Packages\StataEditor.sublime-package\StataEditorPlugin.py", line 63, in StataAutomate
AttributeError: 'module' object has no attribute 'stata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 1082, in run_
    return self.run(edit, **args)
  File "C:\Users\justi\AppData\Roaming\Sublime Text 3\Installed Packages\StataEditor.sublime-package\StataEditorPlugin.py", line 158, in run
  File "C:\Users\justi\AppData\Roaming\Sublime Text 3\Installed Packages\StataEditor.sublime-package\StataEditorPlugin.py", line 66, in StataAutomate
pywintypes.error: (2, 'WinExec', 'The system cannot find the file specified.')

Any insight? Thanks so much!

It seems that stata_path is not correctly specified in user settings file. It complains that the file specified by stata_path cannot be found. Could you check it?

justinsola commented 3 years ago

I fixed this issue on my desktop computer (see issue #42 ) by running as administrator. I did verify the stata_path, what I suspect is that there was a lack of privileges to access or execute the correctly-pathed file. However, I no longer have a stata license on my laptop so I can't be certain it was fixed by checking 'run as administrator' on the stata .exe file.

flcong commented 3 years ago

I fixed this issue on my desktop computer (see issue #42 ) by running as administrator. I did verify the stata_path, what I suspect is that there was a lack of privileges to access or execute the correctly-pathed file. However, I no longer have a stata license on my laptop so I can't be certain it was fixed by checking 'run as administrator' on the stata .exe file.

Ah. It could be. No trouble.

timat35 commented 2 years ago

this could work #50