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

Positron Version: 2024.09.0 (system setup) build 45
Code - OSS Version: 1.92.0
Commit: b0ec249b20455499f9e79ffe0bec35a5ff602ea4
Date: 2024-09-16T02:45:41.974Z
Electron: 30.1.2
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.17763

One the lower left, there is a drop down where I can select the kernel for the console: R.4.4.1 or my python 3.8.18 from the conda environment I call "spark". Unfortunately, both fail to load.

But my first goal is to be able to run a jupyter notebook with a python kernel, then with an R kernel and also a quarto document

If I try to run a code block using the python kernel, it just keeps running with finishing and with no results.

As I suspected (which is why I asked), @Harlananelson seems to be dealing with a very old version of Windows that is past its end of support. In this GitHub issue, we correspond with someone who is running a different, but also very old version of Windows: "R 4.4.1 failed to start up (exit code 0)" · Issue #3788 · posit-dev/positron · GitHub. That issue contains some additional information on why this may be problematic. I am still going to experiment with one easy modification that might help.

That being said, the main piece of advice is to use a newer version of Windows.

My info on this Windows version came from asking ChatGPT about it, so I'll record the conversation here:

What version of Windows is this and when was it released: Windows_NT x64 10.0.17763

The version Windows_NT x64 10.0.17763 refers to Windows 10, version 1809, also known as the Windows 10 October 2018 Update. This version of Windows was released in October 2018.

Is this version of windows considered supported still?

Windows 10, version 1809 (build 17763), also known as the October 2018 Update, reached end of support for most consumer and enterprise versions on May 11, 2021. However, certain editions such as Enterprise and Education versions received extended support until May 9, 2023.

1 Like

My guess is other problems, such as not being able to connect correctly to Databricks remotely is also related to this problem. Thanks. I have to try to convince my workplace to allow an update.

Original Request:
Requesting that his Virtual Sessions run on Windows 11 vs Windows 10

Resolution Details:
Sent email to Harlan with the following information: Windows 11 won't be available on virtual sessions until the end of H1 2025.

Hi all...
I recently installed Positron. Using R Studio for more than 5 years from now. Mac OS is my system. As discussed above, I couldn't see the R Interpreter within Positron. Need help. R works fine within terminal but not recognised in console.

R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

platform aarch64-apple-darwin20
arch aarch64
os darwin20
system aarch64, darwin20
status
major 4
minor 4.1
year 2024
month 06
day 14
svn rev 86737
language R
version.string R version 4.4.1 (2024-06-14)
nickname Race for Your Life

I appreciate the effort that has gone in to checking this error, and just wanted to chime that my colleagues and I are also struggling with this issue. Like the OP, our company uses VMs running older versions of Windows in order to access databases associated with older versions of SQL Server. While my understanding is we could still access SQL data stored on a machine with an older OS/SQL Server version from a VM with a newer OS -- and I'm working with our network team on spinning these up -- I thought it might be helpful context in case the fix actually was simple and therefore might be justified despite the OS being past its "Mainstream End Date" for support.