rstudio / reticulate

R Interface to Python
https://rstudio.github.io/reticulate
Apache License 2.0
1.68k stars 328 forks source link

bug report:Error in py_call_impl and com_error: RPC #1033

Open yanyu2015 opened 3 years ago

yanyu2015 commented 3 years ago
Error in py_call_impl(callable, dots$args, dots$keywords) : 
  AttributeError: 'NoneType' object has no attribute 'Hwnd'

Detailed traceback:
  File "D:\DATASC~1\PYTHON~1\IDES\Anaconda\lib\pprint.py", line 153, in pformat
    self._format(object, sio, 0, 0, {}, 0)
  File "D:\DATASC~1\PYTHON~1\IDES\Anaconda\lib\pprint.py", line 170, in _format
    rep = self._repr(object, context, level)
  File "D:\DATASC~1\PYTHON~1\IDES\Anaconda\lib\pprint.py", line 404, in _repr
    repr, readable, recursive = self.format(object, context.copy(),
  File "D:\DATASC~1\PYTHON~1\IDES\Anaconda\lib\pprint.py", line 417, in format
    return _safe_repr(object, context, maxlevels, level, self._sort_dicts)
  File "D:\DATASC~1\PYTHON~1\IDES\Anaconda\lib\pprint.py", line 569, in _safe_repr
    rep = repr(object)
  File "D:\DATASC~1\PYTHON~1\IDES\Anaconda\lib\site-packages\xlwings\main.py", line 448, in __repr__
    MySum = x + y
  File "D:\DATASC~1\PYTHON~1\IDES\Anaconda\lib\site-packages\xlwings\main.py", line 392, in pid
  File "D:\DATASC~1\PYTHON~1\IDES\Anaconda\
Error in py_call_impl(callable, dots$args, dots$keywords) : 
  com_error: (-2147023174, 'RPC 鏈嶅姟鍣ㄤ笉鍙敤銆
Error in py_call_impl(callable, dots$args, dots$keywords) : 
  com_error: (-2147417848, '琚皟鐢ㄧ殑瀵硅薄宸蹭笌鍏跺鎴风鏂紑杩炴帴銆

my code(for testing) is as follow:

import xlwings as xw

app = xw.App(visible=True,add_book=False)
wb = app.books.open('style223.xlsx')
wb.save('example.xlsx')
wb.close()
app.quit()

my configuration:

Rstudio is Version 1.4.1106
R version is 4.1.0
reticulate_1.20-9002
xlwings 0.24.4

the core error is Error in py_call_impl(callable, dots$args, dots$keywords) : and com_error: (-2147023174, 'RPC it appears some many times not only in this code. I have set the RPC service to be automatic. It seems strange that the code can run successfully(so is example.xlsx is produced but with error message above), I have tried to use:

remotes::install_github("rstudio/reticulate")

but it doesn‘t work

yanyu2015 commented 3 years ago

why there is anyone who helps me and tries to fix this problem?