Skip to content

Installing IPyStata for Stata 14 64-bit on Windows 10 & Anaconda3 (64-bit) #39

Description

@dfdthor

%%stata
display "Hello, I am printed in Stata."

produces


com_error Traceback (most recent call last)
C:\Users\Public\Anaconda3\lib\site-packages\win32com\client\dynamic.py in _GetGoodDispatch(IDispatch, clsctx)
88 try:
---> 89 IDispatch = pythoncom.connect(IDispatch)
90 except pythoncom.ole_error:

com_error: (-2147221005, 'Invalid class string', None, None)

During handling of the above exception, another exception occurred:

com_error Traceback (most recent call last)
in
----> 1 get_ipython().run_cell_magic('stata', ' ', 'display "Hello, I am printed in Stata." \n')

C:\Users\Public\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
2356 with self.builtin_trap:
2357 args = (magic_arg_s, cell)
-> 2358 result = fn(*args, **kwargs)
2359 return result
2360

<C:\Users\Public\Anaconda3\lib\site-packages\decorator.py:decorator-gen-127> in stata(self, line, cell, local_ns)

C:\Users\Public\Anaconda3\lib\site-packages\IPython\core\magic.py in (f, *a, **k)
185 # but it's overkill for just that one bit of state.
186 def magic_deco(arg):
--> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):

C:\Users\Public\Anaconda3\lib\site-packages\ipystata\ipystata_magic.py in stata(self, line, cell, local_ns)
318 time.sleep(0.5)
319 self.log_dict[session_id] = os.path.join(self.lib_dir, 'log%s.txt' % session_id)
--> 320 self.session_dict[session_id] = win32com.client.Dispatch("stata.StataOLEApp")
321 self.do_dict[session_id] = self.session_dict[session_id].DoCommandAsync
322 self.session_dict[session_id].UtilShowStata(1)

C:\Users\Public\Anaconda3\lib\site-packages\win32com\client_init_.py in Dispatch(dispatch, userName, resultCLSID, typeinfo, UnicodeToString, clsctx)
93 """
94 assert UnicodeToString is None, "this is deprecated and will go away"
---> 95 dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
96 return __WrapDispatch(dispatch, userName, resultCLSID, typeinfo, clsctx=clsctx)
97

C:\Users\Public\Anaconda3\lib\site-packages\win32com\client\dynamic.py in _GetGoodDispatchAndUserName(IDispatch, userName, clsctx)
112 else:
113 userName = str(userName)
--> 114 return (_GetGoodDispatch(IDispatch, clsctx), userName)
115
116 def _GetDescInvokeType(entry, invoke_type):

C:\Users\Public\Anaconda3\lib\site-packages\win32com\client\dynamic.py in _GetGoodDispatch(IDispatch, clsctx)
89 IDispatch = pythoncom.connect(IDispatch)
90 except pythoncom.ole_error:
---> 91 IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
92 else:
93 # may already be a wrapped class.

com_error: (-2147221005, 'Invalid class string', None, None)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions