mattiasnordin / StataEditor

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

Automation not working #10

Closed andrewzeitlin closed 8 years ago

andrewzeitlin commented 8 years ago

Hi Mattias,

thanks for what looks like a great package. I'm having trouble getting automation working for StataEditor on a windows 7 / 64-bit machine and hoping you might advise. Have followed the vista and manual instructions for this per Stata and I think this step may not be the problem: though I don't get any positive confirmation message, I am able to _un_register stata automation and receive a message when I do so. Still, no joy when I attempt to execute a do file from Sublime Text via StataEditor. Have others experienced this problem? Any advice on how to troubleshoot and fix?

Much appreciated, Andrew

mattiasnordin commented 8 years ago

Hi Andrew, I don't know that may cause this issue. The first thing I would do is to open the console and see what happens when you send code to stata. Do you get an error message or does nothing happen?

Mattias

andrewzeitlin commented 8 years ago

Thanks Mattias for the quick response and willingness to help. Reassuringly, the install worked on another machine, and it is great.

On the problem machine, I'm getting the following error message in the console when I try to send code to stata:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 377, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "CompletionsPlugin in C:\Users\<username>\AppData\Roaming\Sublime Text 3\Installed Packages\StataEditor.sublime-package", line 15, in on_query_completions
AttributeError: 'module' object has no attribute 'stata'
reloading settings Packages/User/StataEditor.sublime-settings

I'm experiencing this even when I log in/set it up under a profile with administrative privileges. Any advice as to what problem this might point to?

Much appreciated, Andrew

mattiasnordin commented 8 years ago

Have you set the correct path to Stata? The default path is "C:/Program Files (x86)/Stata13/StataMP-64.exe", maybe you need to change? In addition, make sure that you have the Pywin32 package installed. Finally, make sure you haven't deleted the shortcut you create when registering the Stata automation object.

Do any of these suggestions solve your problem? Mattias

andrewzeitlin commented 8 years ago

Thanks again Mattias. It seems it wasn't any of the above. But I tried following your advice under (closed) issue #8 -- sorry for not spotting that before -- to check whether automation was working and after re-running the shortcut it seems to now be functioning. May be an issue related to the type of administrative rights in place when automation was first set up -- I'm not entirely sure but happy to say it is now working!

Andrew

mattiasnordin commented 8 years ago

Great!