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.