Pycharm IntelliJ R extension cannot find R interpreter

Viewed 2429

After opening a .R file in Pycharm and trying to run the R code, the error R Console Failure: Cannot run console until path to viable R interpreter is specified appears. The R language plugin is installed, as is R for the computer, but PyCharm File -Settings -Languages and Frameworks does not show R (screenshot Screenshot of problems). RStudio runs the R code in the file without problems. PyCharm used to run it, but after closing and reopening PyCharm, the file no longer runs. I did the Edit Configurations that PyCharm asked and specified a .R configuration: the file is my open file that I want to run, the file directory is the working directory. The file in question is an existing file initially created in RStudio. It is not a PyCharm project. Ubuntu 18.04 on Dell Latitude E 7470.

3 Answers

Restarting PyCharm worked for me.

I was working on a Python project. Then I decided to change to an R project, opened it, and then opened some R files in PyCharm. That's when the error appeared.

I restarted PyCharm and upon reopening it, the R files were all there and the R console was working.

I just encountered a similar problem. I think the issue was that when I created the project in Pycharm. I did not initially choose to create the project as an R Project or R Package. Not sure if it's possibly to work around this if the project was initially designed with Python.

enter image description here

Copying the R file to a folder with a previously working PyCharm project (with a main.R file) and then opening it in PyCharm, the code in the file ran. The problem was solved, but it reappeared after the computer went to sleep and was wakened. The file in the folder of the working PyCharm project no longer ran, but generated the original error. Closing the file in PyCharm and reopening did not work. Closing PyCharm and then doubleclicking the file to open it and PyCharm together worked: the code in the file ran.

Related