In Positron, how can I get the R terminal to work

When I start Positron, it also tries to start the R console. I have R installed at
/d/research/hnelson3/conda-envs/spark/Scripts/R if I have conda activated
or in /d/R-4.4.1/bin/R

In the terminal I can successfully start an R session and which R points to the correct place.
So I know the Path is set correct for the system to find R.

In the CONSOLE, if I click the "Start Console" button, it seem like it tries, but eventually I get the error message, R 4.4.1 failed to start up (exit code 0)

The other dialoge box says
"The terminal process "d:\Program Files\Positron\resources\app\extensions\jupyter-adapter\resources\kernel-wrapper.bat 'C:\Users\hnelson3\AppData\Local\Temp\2\kernel-kcCyqG\kernel.log', 'd:\Program Files\Positron\resources\app\extensions\positron-r\resources\ark\ark.exe', '--connection_file', 'C:\Users\hnelson3\AppData\Local\Temp\2\kernel-kcCyqG\connection.json', '--log', 'C:\Users\hnelson3\AppData\Local\Temp\2\kernel-kcCyqG\kernel.log', '--startup-file', 'd:\Program Files\Positron\resources\app\extensions\positron-r\resources\scripts\startup.R', '--session-mode', 'console', '--', '--interactive', '--no-restore-data'" terminated with exit code: 1.
"

Is there a way to tell Positron where to look for R.?

I notice that it is the kernel-adapter which is failing to come up, and I have observed that problem on Windows if I haven't installed the Visual C++ Redistributable, as outlined in our Windows perquisites. Is that already installed on your machine?

1 Like

I might need to assign a value to InstallPath

Positron R Extension

2024-08-06 15:51:33.202 [info] Log level: Debug
2024-08-06 15:51:33.204 [info] Refreshing testthat status
2024-08-06 15:51:33.205 [info] Not working in an R package
2024-08-06 15:51:33.205 [info] Context key 'testthatIsConfigured' is 'false'
2024-08-06 15:51:33.205 [info] Context key 'testthatHasTests' is 'false'
2024-08-06 15:51:33.330 [info] Checking for 'InstallPath' in registry key \Software\R-Core\R64 for hive HKCU
2024-08-06 15:51:33.569 [info] Checking for 'InstallPath' in registry key \Software\R-Core\R64 for hive HKCU
2024-08-06 15:51:37.677 [info] Unable to get value of 'InstallPath': QUERY command exited with code 1:

ERROR: The system was unable to find the specified registry key or value.
2024-08-06 15:51:37.825 [info] Checking for 'InstallPath' in registry key \Software\WOW6432Node\R-Core\R64 for hive HKCU
2024-08-06 15:51:37.950 [info] Unable to get value of 'InstallPath': QUERY command exited with code 1:

ERROR: The system was unable to find the specified registry key or value.
2024-08-06 15:51:37.954 [info] Checking for 'InstallPath' in registry key \Software\WOW6432Node\R-Core\R64 for hive HKCU
2024-08-06 15:51:40.891 [info] Unable to get value of 'InstallPath': QUERY command exited with code 1:

ERROR: The system was unable to find the specified registry key or value.
2024-08-06 15:51:40.917 [info] Checking for 'InstallPath' in registry key \Software\R-Core\R64 for hive HKLM
2024-08-06 15:51:41.420 [info] Unable to get value of 'InstallPath': QUERY command exited with code 1:

ERROR: The system was unable to find the specified registry key or value.
2024-08-06 15:51:41.521 [info] Checking for 'InstallPath' in registry key \Software\R-Core\R64 for hive HKLM
2024-08-06 15:51:46.537 [info] Identified the current version of R from the registry: D:\Program Files\R-4.4.1\bin\x64\R.exe
2024-08-06 15:51:46.676 [info] Candidate R binary at D:\Program Files\R-4.4.1\bin\x64\R.exe
2024-08-06 15:51:46.678 [info] R installation discovered: {
  "valid": true,
  "supported": true,
  "binpath": "D:\\Program Files\\R-4.4.1\\bin\\x64\\R.exe",
  "homepath": "D:\\Program Files\\R-4.4.1",
  "semVersion": {
    "options": {},
    "loose": false,
    "includePrerelease": false,
    "raw": "4.4.1",
    "major": 4,
    "minor": 4,
    "patch": 1,
    "prerelease": [],
    "build": [],
    "version": "4.4.1"
  },
  "version": "4.4.1",
  "arch": "x86_64",
  "current": true,
  "orthogonal": true
}
2024-08-06 15:51:55.155 [info] Identified the current version of R from the registry: D:\Program Files\R-4.4.1\bin\x64\R.exe
2024-08-06 15:51:55.205 [info] Candidate R binary at D:\Program Files\R-4.4.1\bin\x64\R.exe
2024-08-06 15:51:55.221 [info] R installation discovered: {
  "valid": true,
  "supported": true,
  "binpath": "D:\\Program Files\\R-4.4.1\\bin\\x64\\R.exe",
  "homepath": "D:\\Program Files\\R-4.4.1",
  "semVersion": {
    "options": {},
    "loose": false,
    "includePrerelease": false,
    "raw": "4.4.1",
    "major": 4,
    "minor": 4,
    "patch": 1,
    "prerelease": [],
    "build": [],
    "version": "4.4.1"
  },
  "version": "4.4.1",
  "arch": "x86_64",
  "current": true,
  "orthogonal": true
}

The Console: R 4.4.1 log File

  • Name: Kernal.log
  • Type: Log fiel Source File
  • Folder Path: C:\Users\hnelson3\AppData\Local\Temp\2\kernel-XZjJho\kernel.log
  • Size: 0 bytes
2024-08-06 15:51:59.388 [info] [Positron] Connecting to R 4.4.1 kernel (pid 12780)
2024-08-06 15:51:59.389 [info] [Positron] Streaming log file: C:\Users\hnelson3\AppData\Local\Temp\2\kernel-tBN9Hu\kernel.log
2024-08-06 15:51:59.391 [info] [Positron] Connecting to kernel sockets defined in C:\Users\hnelson3\AppData\Local\Temp\2\kernel-tBN9Hu\connection.json...
2024-08-06 15:51:59.391 [info] [Positron] Control socket created (count = 1)
2024-08-06 15:51:59.392 [info] [Positron] Shell socket created (count = 2)
2024-08-06 15:51:59.393 [info] [Positron] Stdin socket created (count = 3)
2024-08-06 15:51:59.394 [info] [Positron] I/O socket created (count = 4)
2024-08-06 15:51:59.394 [info] [Positron] Heartbeat socket created (count = 5)
2024-08-06 15:51:59.395 [info] [Positron] Control socket connecting to tcp://127.0.0.1:42803...
2024-08-06 15:51:59.395 [info] [Positron] Shell socket connecting to tcp://127.0.0.1:45910...
2024-08-06 15:51:59.396 [info] [Positron] Stdin socket connecting to tcp://127.0.0.1:64502...
2024-08-06 15:51:59.397 [info] [Positron] I/O socket connecting to tcp://127.0.0.1:65273...
2024-08-06 15:51:59.398 [info] [Positron] Heartbeat socket connecting to tcp://127.0.0.1:57699...
[Positron] Control socket still connecting (2s)
[Positron] Shell socket still connecting (2s)
[Positron] Stdin socket still connecting (2s)
[Positron] I/O socket still connecting (2s)
[Positron] Heartbeat socket still connecting (2s)
[Positron] Control socket still connecting (4s)
[Positron] Shell socket still connecting (4s)
[Positron] Stdin socket still connecting (4s)
[Positron] I/O socket still connecting (4s)
[Positron] Heartbeat socket still connecting (4s)
[Positron] R 4.4.1 failed to start; exit code: 1
[Positron] R kernel status changed: starting => exited
[Positron] Connecting to R 4.4.1 kernel (pid 800)
[Positron] Streaming log file: C:\Users\hnelson3\AppData\Local\Temp\2\kernel-XZjJho\kernel.log
[Positron] Connecting to kernel sockets defined in C:\Users\hnelson3\AppData\Local\Temp\2\kernel-XZjJho\connection.json...
[Positron] Control socket created (count = 1)
[Positron] Shell socket created (count = 2)
[Positron] Stdin socket created (count = 3)
[Positron] I/O socket created (count = 4)
[Positron] Heartbeat socket created (count = 5)
[Positron] Control socket connecting to tcp://127.0.0.1:61687...
[Positron] Shell socket connecting to tcp://127.0.0.1:47533...
[Positron] Stdin socket connecting to tcp://127.0.0.1:46941...
[Positron] I/O socket connecting to tcp://127.0.0.1:54316...
[Positron] Heartbeat socket connecting to tcp://127.0.0.1:59414...
[Positron] R 4.4.1 failed to start; exit code: 1
[Positron] R kernel status changed: starting => exited

Jypyter Adapter

R kernel status changed: uninitialized => initializing
R kernel status changed: initializing => starting
Starting R 4.4.1 kernel: d:\Program Files\Positron\resources\app\extensions\positron-r\resources\ark\ark.exe --connection_file C:\Users\hnelson3\AppData\Local\Temp\2\kernel-XZjJho\connection.json --log C:\Users\hnelson3\AppData\Local\Temp\2\kernel-XZjJho\kernel.log --startup-file d:\Program Files\Positron\resources\app\extensions\positron-r\resources\scripts\startup.R --session-mode console -- --interactive --no-restore-data...

Python kernel status changed: uninitialized => initializing
Python kernel status changed: initializing => starting
Starting Python 3.10.13 (Conda: base) kernel: D:\programfiles\conda\python.exe d:\Program Files\Positron\resources\app\extensions\positron-python\python_files\positron\positron_language_server.py -f C:\Users\hnelson3\AppData\Local\Temp\2\kernel-7Yequz\connection.json --logfile C:\Users\hnelson3\AppData\Local\Temp\2\kernel-7Yequz\kernel.log --loglevel=error --session-mode=notebook...

Can you take a look at some of your output and logs? We have some info on troubleshooting here. It would be helpful to know:

  • what's in the output for the "Positron R Extension", something like this:
2024-08-06 14:21:09.537 [info] Resolved R binary at /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/bin/R
2024-08-06 14:21:09.538 [info] Candidate R binary at /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/bin/R
2024-08-06 14:21:09.538 [info] R installation discovered: {
  "valid": true,
  "supported": true,
  "binpath": "/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/bin/R",
  "homepath": "/Library/Frameworks/R.framework/Resources",
  "semVersion": {
    "options": {},
    "loose": false,
    "includePrerelease": false,
    "raw": "4.4.0",
    "major": 4,
    "minor": 4,
    "patch": 0,
    "prerelease": [],
    "build": [],
    "version": "4.4.0"
  },
  "version": "4.4.0",
  "arch": "arm64",
  "current": true,
  "orthogonal": false
}
2024-08-06 14:21:10.153 [info] Creating Positron R 4.4.0 language client (port 55777)
2024-08-06 14:21:10.153 [info] ARK (R 4.4.0) language client state changed uninitialized => starting
2024-08-06 14:21:10.232 [info] ARK (R 4.4.0) language client init successful
2024-08-06 14:21:10.232 [info] ARK (R 4.4.0) language client state changed starting => running
  • In the "Console: R 4.4.1" output channel, you'll see a line like this one:
[Positron] Streaming log file: /var/folders/hv/hzsmmyk9393_m7q3nscx1slc0000gn/T/kernel-A8XVoD/kernel.log

Can you share the contents of that file?

  • Can you look in the output for the "Jupyter Adapter" extension? Is there anything there, or is it empty?

  • Is there any antivirus/malware software on your machine? If so, can you check its logs for references to kernel-wrapper or ark.exe ?

I added those contents to my original question.

Thanks for your patience on this! :raised_hands: We have another possibility for diagnosing the problem, if you are willing to give it a try.

Image

  • Complete close Positron and reopen it
  • Go to the terminals; you will see an additional one for R and/or Python. Mine look like this for both R and Python (totally blank), because my interpreters can start fine and all the output is going where it is intended:

Image

What do you see there? :eyes:

I'd also like to see the Help > About information re: Positron.
Specifically, I am interested in the exact Windows version, i.e. the last line here:

Positron Version: 2024.08.0 (system setup) build 48
Code - OSS Version: 1.91.0
Commit: ed616b36655fb24d116108bdd833f1321704315b
Date: 2024-08-19T03:30:12.447Z
Electron: 29.4.0
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.20348