Pycharm R error -- Cannot run console: RWrapper terminated, exit code 1

Hi,

 

I am trying to run my R scripts on a remote linux server with the Pycharm installation from my local windows 10 computer. On the server I have a conda environment that I can access with for instance jupyter notebook. That works fine. I had hoped to be able to debug my scripts for further development with Pycharm and R plugin. 

I got the plugin for R in Pycharm, I changed the R interpreter to the correct interpreter. Connection is made with the host and with the function "Run script as job" I can run my remote file all fine and I see print output in the R console of Pycharm. 

But I get the following popup when I open Pycharm

The interpreter seems fine

 

But I cannot debug my file or run it with any of these buttons

 

Does anybody know what I am missing? 

 

Thank you so much in advance!

Kiki

 

 

4 comments
Comment actions Permalink

Hello, Kiki!

Could you please provide information about the system on your remote Linux host?
R Plugin will work only with Ubuntu 16.04 and above or with something similar.

Also could you please run this command:

$ strings /lib64/libstdc++.so.6 | grep LIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
...

And paste here the result.

0
Comment actions Permalink

Hi Parviz! 

Thank you so much for your reply! It has been a matter of great frustration with me for the past weeks. 

 

- First question about the system information: maybe here already is a problem? My system has RHEL Server 7.8

I have the following information about my linux host:

Linux 3.10.0-1127.8.2.el7.x86_64 #1 SMP Thu May 7 19:4 x86_64 x86_64 GNU/Linux

Red Hat Enterprise Linux Server release 7.8 (Maipo)

 

- Second question about the LIBCXX versions

$ strings /lib64/libstdc++.so.6 | grep LIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_DEBUG_MESSAGE_LENGTH

So, indeed here the needed versions are missing. But if I do the same thing with the path of my conda environment included, I do see the correct versions listed:

$ strings /data/software/anaconda3/envs/r2m3Seurat/lib/libstdc++.so.6 | grep LIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_DEBUG_MESSAGE_LENGTH

And a lot of extra information underneath

Yesterday, based on this post https://stackoverflow.com/questions/36376474/program-looks-for-libstdc-so-6-in-wrong-place-and-seems-to-ignore-ld-library-p I tried to add the path to my LD_LIBRARY_PATH, but that too did not make any difference for the error notification. 

I did it with an environment adaption, like the accepted answer in the post here describes: https://stackoverflow.com/questions/46826497/conda-set-ld-library-path-for-env-only 

Before the command   

$ echo $LD_LIBRARY_PATH

was empty, and after my LD_LIBRARY_PATH adaptation, the echo command shows my path:

$ echo $LD_LIBRARY_PATH
/data/software/anaconda3/envs/r2m3Seurat/lib/
$

The error message is the same though. Therefore I removed my path again from the LD_LIBRARY_PATH.

I hope I didn't mess up anything big and that you can help me further.

 

Thank you so much for your time, I really appreciate it!

Kiki

 

 

0
Comment actions Permalink

Hi Kiki!

I created an issue to support such behaviour https://youtrack.jetbrains.com/issue/R-1043 (You can follow it).

Also, I have a work around for you, but note, that it can break connection to another remote interpreter on Linux with R Plugin.

On your Windows host machine go there:

C:\Users\<username>\AppData\Roaming\JetBrains\PyCharm2020.2\plugins\rplugin\R

Open file GetEnvVar.R to edit and replace:

else if (get_os() == "linux") Sys.getenv("LD_LIBRARY_PATH")

with

else if (get_os() == "linux") "/data/software/anaconda3/envs/r2m3Seurat/lib:/data/software/anaconda3/envs/r2m3Seurat/lib/R/lib"

After this you should delete directory /data/cgi/.jetbrains_rplugin_helpers on your remote host and restart IDE.

Now you should be able to work with your remote interpreter.

0
Comment actions Permalink

Wow Parviz, that works like a (py)charm! - sorry, I'm so excited that it works, the pun just couldn't be resisted 

Still I wonder if I made a mistake in my export LD_LIBRARY_PATH statement in the remote env_vars.sh, because it does seem that the problem is exactly that the path was not correct. Will try that again, this time with the second path that you added in your "hack statement".

Anyway, thank you so much! I'm watching the ticket that you created to see if any longer term solution or other insight comes along. 

Thanks!

Kiki

1

Please sign in to leave a comment.