79807491

Date: 2025-11-03 02:27:14
Score: 0.5
Natty:
Report link

Finally I reached a solution, which maybe dumb but the easiest way to escape the problem.

>>> `import rpy2`
>>> try: 
>>>     `from rpy2.robjects.packages import importr`
>>> finally:
>>>     `from rpy2.robjects.packages import importr` 

The try will test the code. Of course, it fails with the same error message. If the code without a try then it will stop there and all code after that won't run. Now a try & finally lines will repeat the code two times to guarantee the lines after finally will run without stops or other error messages.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Ke Nan