GithubHelp home page GithubHelp logo

Build Not Working Correctly about stataeditor HOT 8 CLOSED

mcfibb avatar mcfibb commented on July 17, 2024
Build Not Working Correctly

from stataeditor.

Comments (8)

mcfibb avatar mcfibb commented on July 17, 2024 1

There it is! Fantastic -- thank you! I think the issue actually may have been that I wasn't running the Command Prompt as an administrator. Here's to following directions better next time.

Seriously, many thanks.

from stataeditor.

harningle avatar harningle commented on July 17, 2024

Sorry I'm not very sure with the problem, and have not used Stata for a while. Would you please check a few things:

  • Preference > Package Settings > StataEditor > Settings - User: is stata_path correct? stata_version correct? It should look like "stata_path": "C:/Program Files/Stata18/StataMP-64.exe",, depending your Stata version/installation path
  • ctrl + ` to go to console, run line by line:
    import sublime
    import win32api
    
    settings_file = "StataEditor.sublime-settings"
    settings = sublime.load_settings(settings_file)  # Any error here?
    print(settings.get("stata_path"))                # Does it print your `stata_path` that you set above?
    
    win32api.WinExec(settings.get("stata_path"))     # Is your Stata opening?

from stataeditor.

mcfibb avatar mcfibb commented on July 17, 2024

Super help, thanks! I ran into an error on the import of win32api. Googled and saw someone with a similar issue, wherein Python 3.8 is the default for Sublime 4, not Python 3.3. I switched the version of Python in the command window and followed your steps again. Works as expected. I'll modify Sublime settings to default to 3.3.

from stataeditor.

mcfibb avatar mcfibb commented on July 17, 2024

Update: Still running into issues. I don't know if it's because the program requires 3.3 to be run, and if so, I can't figure out how to change that dependency, either in the StataEditor build file or the Python build file. Interestingly, I can get Stata to open, but code is not passed to it. Any ideas?

from stataeditor.

harningle avatar harningle commented on July 17, 2024

Update: Still running into issues. I don't know if it's because the program requires 3.3 to be run, and if so, I can't figure out how to change that dependency, either in the StataEditor build file or the Python build file. Interestingly, I can get Stata to open, but code is not passed to it. Any ideas?

What's the error message now? (Or are there any errors or warnings when you run the stata code?)

from stataeditor.

mcfibb avatar mcfibb commented on July 17, 2024

Here's the output:

  File "C:\Users\User\AppData\Roaming\Sublime Text\Installed Packages\StataEditor.sublime-package\StataEditorPlugin.py", line 68, 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:\Users\User\AppData\Roaming\Sublime Text\Packages\Pywin32\lib\x64\win32com\client\dynamic.py", line 89, in _GetGoodDispatch
    IDispatch = pythoncom.connect(IDispatch)
pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text\Lib\python33\sublime_plugin.py", line 1493, in run_
    return self.run(edit, **args)
  File "C:\Users\User\AppData\Roaming\Sublime Text\Installed Packages\StataEditor.sublime-package\StataEditorPlugin.py", line 170, in run
  File "C:\Users\User\AppData\Roaming\Sublime Text\Installed Packages\StataEditor.sublime-package\StataEditorPlugin.py", line 76, in StataAutomate
  File "C:\Users\User\AppData\Roaming\Sublime Text\Packages\Pywin32\lib\x64\win32com\client\__init__.py", line 95, in Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Users\User\AppData\Roaming\Sublime Text\Packages\Pywin32\lib\x64\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Users\User\AppData\Roaming\Sublime Text\Packages\Pywin32\lib\x64\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)

from stataeditor.

harningle avatar harningle commented on July 17, 2024

pywintypes.com_error: (-2147221005, xxxxx suggests that python cannot find stata in the registry. Can you do this to register the stata automation lib again?

from stataeditor.

mcfibb avatar mcfibb commented on July 17, 2024

Sure thing. Gimme a sec.

from stataeditor.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.