MikhailArkhipov / vscode-r

R Tools for VS Code
Other
82 stars 6 forks source link

How to use conda R as interpreter in Windows 10 #38

Closed abalter closed 4 years ago

abalter commented 5 years ago

I have installed conda and R in Windows 10. Right now I have not added conda to my path, which is the recommended installation option.

Is there a way to have R Tools initiate a conda environment and use that R interperter?

abalter commented 5 years ago

Update: I added my conda world to my path. Now in a fresh cmd I get:

C:\Windows\System32>where R
C:\Users\ariel\Miniconda3\Scripts\R.exe

However, VS Code still doesn't see my R interpreter.

MikhailArkhipov commented 5 years ago

It is not path dependent, R is discovered in registry. Have a look here https://github.com/Microsoft/RTVS/issues/3265 on how to specify custom interpreter location.

abalter commented 5 years ago

Thanks @MikhailArkhipov . I'll have to try reading through that a few more times. I couldn't understand it.

On the good side, I was finally able to get VS Code open in WSL. I installed .NET in Ubuntu, and it found my conda R out of the gate.

Question: does the r-tools extension have a variable viewer?

MikhailArkhipov commented 5 years ago

No it doesn't have UI. Custom R location can be specified in the JSON file - Microsoft.R.Host.Broker.json located next to Microsoft.R.Host.Broker.exe. Example:

{
"server.urls": "https://0.0.0.0:5444",
  "R": {
    "Interpreters": {
      "0": {
        "name": "MRO",
        "basePath": "C:\\Program Files\\Microsoft\\MRO-3.3.2"
      },
      "1": {
        "name": "MSSQL R Services",
        "basePath": "C:\\Program Files\\Microsoft SQL Server\\MSSQL13.MSSQL01\\R_SERVICES"
      }
    }
  }
}
abalter commented 5 years ago

Sorry! I used the wrong term. Perhaps "variable inspector?" As in RStudio or Spyder where you can see the values of variables in the current environment.

MikhailArkhipov commented 5 years ago

No, it doesn't. Maybe some day it would be possible to borrow one from Python data science tools. VS Code is not an IDE and not particularly friendly to visualizations.

abalter commented 5 years ago

I'm hoping that some awesome folks build a replacement for RStudio and Spyder out of Theia that runs on desktop and cloud.

But thanks for your great work!

MikhailArkhipov commented 5 years ago

Judging from https://theia-ide.org it is a fork of VS Code. Even icons are the same. And it supports VSC extensions directly. So it is the same thing.

abalter commented 5 years ago

I had thought so. I posted a question, and this is what I was told:

The most significant differences are: Theia's architecture is more modular and allows for way more customizations, Theia is designed from the ground to run on Desktop and Cloud, and Theia is developed under a vendor-neutral Open-Source Foundation.

And

It does not rely on VS Code internals for features outside of an editor.

More here.

abalter commented 5 years ago

It remains to be seen how well it takes off. The Eclipse project never stormed the world, but has had a stable following. I like the idea that this is a platform for building custom IDEs that simultaneously target desktop and browser. This is needed. I'm hoping someone creates a great data science IDE with this platform.

MikhailArkhipov commented 4 years ago

Try 0.0.9.

"r.interpreterPath": "C:\\Program Files\\R\\R-3.4.3"

i.e. root folder. without bin/x64