Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarto can't locate R installation with path containing special characters #8688

Open
rroelz opened this issue Feb 12, 2024 · 5 comments
Open
Assignees
Labels
bug Something isn't working windows
Milestone

Comments

@rroelz
Copy link

rroelz commented Feb 12, 2024

Bug description

When trying to use quarto on my windows pc from RStudio or powershell it can't locate my R installation, breaking with the message.

ERROR: Error executing 'C:\Users\RobinR�lz\AppData\Local\Programs\R\R-4.3.2\bin\x64\Rscript.exe': Das System kann den angegebenen Pfad nicht finden. (os error 3)

Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/

R has been added to the path at :C:\Users\RobinRölz\AppData\Local\Programs\R\R-4.3.2\bin\x64\R.exe

Steps to reproduce

Have R installed in a location with a special character (I wasn't able to try as this is only a work pc and I can't install anything outside my user account)

quarto.cmd render test.qmd

Expected behavior

Quarto renders the document.

Actual behavior

Quarto can't locate R and doesn't render the document.

Your environment

  • Windows 11 Enterprise: 22H2
  • Powershell: 1.0
  • RStudio: Ocean Storm" Release (4da58325, 2024-01-28) for windows
  • R: version 4.3.2 (2023-10-31 ucrt) -- "Eye Holes"

Quarto check output

Quarto 1.4.549
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.4.549
      Path: C:\Users\RobinRölz\AppData\Local\Programs\Quarto\bin\
      CodePage: unknown

[>] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Tex:  (not detected)

(\) Checking basic markdown render....pandoc: Cannot decode byte '\xf6': Data.Text.Encoding: Invalid UTF-8 stream
[>] Checking basic markdown render....OK
@rroelz rroelz added the bug Something isn't working label Feb 12, 2024
@cscheid cscheid added the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label Feb 12, 2024
@cderv
Copy link
Collaborator

cderv commented Feb 20, 2024

Thanks for the report.

This could be related to other codepage-related issues

The other error shown seems related too

pandoc: Cannot decode byte '\xf6': Data.Text.Encoding: Invalid UTF-8 stream

Can you run the command at #4103 (comment) to check which codepage you have ?

quarto check report unknown which is unexpected by could be related to what happens in #8530

Knowing the codepage will help us reproduce.

thank you.

@cderv cderv removed the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label Feb 20, 2024
@cderv
Copy link
Collaborator

cderv commented Feb 20, 2024

Can you also run the command for quarto check with verbose mode activitated ?

https://quarto.org/docs/troubleshooting/#verbose-mode

This will show debug log about R detection.

Thank you.

@rroelz
Copy link
Author

rroelz commented Feb 23, 2024

I also talked with a friend later and he mentioned codepages. I've been mostly on Linux the last while so I need to get more into Windows again. I haven't tried running through Rstudio yet.

Get-ItemPropertyValue -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\CodePage" -Name ACP

1252

Get-ItemPropertyValue -Path "HKCU:\SYSTEM\CurrentControlSet\Control\Nls\CodePage" -Name ACP

Error Message:

Get-ItemPropertyValue : Der Pfad
"HKCU:\SYSTEM\CurrentControlSet\Control\Nls\CodePage" kann
nicht gefunden werden, da er nicht vorhanden ist.
In Zeile:1 Zeichen:1
+ Get-ItemPropertyValue -Path
"HKCU:\SYSTEM\CurrentControlSet\Control\N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKCU:\SYSTEM
   \Cu...ol\Nls\CodePage:String) [Get-ItemPropertyValue],
  ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerS
   hell.Commands.GetItemPropertyValueCommand
# The key we need 
Get-ChildItem -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\CodePage"
    Hive: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro
    l\Nls\CodePage


Name                           Property
----                           --------
EUDCCodeRange                  932 : F040-F9FC
                               936 :
                               AAA1-AFFE,F8A1-FEFE,A140-A7A0
                               949 : C9A1-C9FE,FEA1-FEFE
                               950 : FA40-FEFE,8E40-A0FE,814
                               0-8DFE,C6A1-C8FE
Get-ChildItem -Path "HKCU:\SYSTEM\CurrentControlSet\Control\Nls\CodePage"

also erroring not found

# All properties available 
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\CodePage"
10000             : c_10000.nls
10001             : c_10001.nls
10002             : c_10002.nls
10003             : c_10003.nls
10004             : c_10004.nls
10005             : c_10005.nls
10006             : c_10006.nls
10007             : c_10007.nls
10008             : c_10008.nls
10010             : c_10010.nls
10017             : c_10017.nls
10021             : c_10021.nls
10029             : c_10029.nls
10079             : c_10079.nls
10081             : c_10081.nls
10082             : c_10082.nls
1026              : c_1026.nls
1047              : c_1047.nls
1140              : c_1140.nls
1141              : c_1141.nls
1142              : c_1142.nls
1143              : c_1143.nls
1144              : c_1144.nls
1145              : c_1145.nls
1146              : c_1146.nls
1147              : c_1147.nls
1148              : c_1148.nls
1149              : c_1149.nls
1250              : c_1250.nls
1251              : c_1251.nls
1252              : c_1252.nls
1253              : c_1253.nls
1254              : c_1254.nls
1255              : c_1255.nls
1256              : c_1256.nls
1257              : c_1257.nls
1258              : c_1258.nls
1361              : c_1361.nls
20000             : c_20000.nls
20001             : c_20001.nls
20002             : c_20002.nls
20003             : c_20003.nls
20004             : c_20004.nls
20005             : c_20005.nls
20105             : c_20105.nls
20106             : c_20106.nls
20107             : c_20107.nls
20108             : c_20108.nls
20127             : c_20127.nls
20261             : c_20261.nls
20269             : c_20269.nls
20273             : c_20273.nls
20277             : c_20277.nls
20278             : c_20278.nls
20280             : c_20280.nls
20284             : c_20284.nls
20285             : c_20285.nls
20290             : c_20290.nls
20297             : c_20297.nls
20420             : c_20420.nls
20423             : c_20423.nls
20424             : c_20424.nls
20833             : c_20833.nls
20838             : c_20838.nls
20866             : c_20866.nls
20871             : c_20871.nls
20880             : c_20880.nls
20905             : c_20905.nls
20924             : c_20924.nls
20932             : c_20932.nls
20936             : c_20936.nls
20949             : c_20949.nls
21025             : c_21025.nls
21027             : c_21027.nls
21866             : c_21866.nls
28591             : C_28591.NLS
28592             : C_28592.NLS
28593             : c_28593.nls
28594             : C_28594.NLS
28595             : C_28595.NLS
28596             : C_28596.NLS
28597             : C_28597.NLS
28598             : c_28598.nls
28599             : c_28599.nls
28603             : c_28603.nls
28605             : c_28605.nls
37                : c_037.nls
38598             : c_28598.nls
437               : c_437.nls
500               : c_500.nls
50220             : c_is2022.dll
50221             : c_is2022.dll
50222             : c_is2022.dll
50225             : c_is2022.dll
50227             : c_is2022.dll
50229             : c_is2022.dll
51949             : c_20949.nls
52936             : c_is2022.dll
54936             : c_g18030.dll
55000             : c_gsm7.dll
55001             : c_gsm7.dll
55002             : c_gsm7.dll
55003             : c_gsm7.dll
55004             : c_gsm7.dll
57002             : c_iscii.dll
57003             : c_iscii.dll
57004             : c_iscii.dll
57005             : c_iscii.dll
57006             : c_iscii.dll
57007             : c_iscii.dll
57008             : c_iscii.dll
57009             : c_iscii.dll
57010             : c_iscii.dll
57011             : c_iscii.dll
708               : c_708.nls
720               : c_720.nls
737               : c_737.nls
775               : c_775.nls
850               : c_850.nls
852               : c_852.nls
855               : c_855.nls
857               : c_857.nls
858               : c_858.nls
860               : c_860.nls
861               : c_861.nls
862               : c_862.nls
863               : c_863.nls
864               : c_864.nls
865               : c_865.nls
866               : c_866.nls
869               : c_869.nls
870               : c_870.nls
874               : c_874.nls
875               : c_875.nls
932               : c_932.nls
936               : c_936.nls
949               : c_949.nls
950               : c_950.nls
AllowDeprecatedCP : 1111573537
OEMHAL            : vgaoem.fon
ACP               : 1252
OEMCP             : 850
MACCP             : 10000
PSPath            : Microsoft.PowerShell.Core\Registry::HKEY
                    _LOCAL_MACHINE\SYSTEM\CurrentControlSet\
                    Control\Nls\CodePage
PSParentPath      : Microsoft.PowerShell.Core\Registry::HKEY
                    _LOCAL_MACHINE\SYSTEM\CurrentControlSet\
                    Control\Nls
PSChildName       : CodePage
PSDrive           : HKLM
PSProvider        : Microsoft.PowerShell.Core\Registry
Get-ItemProperty -Path "HKCU:\SYSTEM\CurrentControlSet\Control\Nls\CodePage"

error, not found

Lastly the output of quarto check with the debug mode on is:

Quarto version: 1.4.549
Quarto 1.4.549
[>] Checking versions of quarto binary dependencies...
[execProcess] C:\Users\RobinRölz\AppData\Local\Programs\Quarto\bin\tools\pandoc --version
[execProcess] Success: true, code: 0
      Pandoc version 3.1.11: OK
[execProcess] C:\Users\RobinRölz\AppData\Local\Programs\Quarto\bin\tools\x86_64\dart-sass\sass.bat --version
[execProcess] Success: true, code: 0
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.4.549
      Path: C:\Users\RobinRölz\AppData\Local\Programs\Quarto\bin\
[execProcess] reg query HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage /v ACP
      CodePage: unknown

[execProcess] cmd /c C:\Users\ROBINR~1\AppData\Local\Temp\quarto-safe-execfc6763d3.bat
[execProcess] Success: true, code: 0
[execProcess] Success: false, code: 1
[>] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[execProcess] cmd /c C:\Users\ROBINR~1\AppData\Local\Temp\quarto-safe-exec26e8a8f9.bat
[execProcess] Success: false, code: 1
[execProcess] cmd /c C:\Users\ROBINR~1\AppData\Local\Temp\quarto-safe-execfa89ae47.bat
[execProcess] Success: false, code: 1
[>] Checking LaTeX....................OK
      Tex:  (not detected)

Error loading deno-dom-native: Could not open library: Das angegebene Modul wurde nicht gefunden.

[execProcess] C:\Users\RobinRölz\AppData\Local\Programs\Quarto\bin\tools\x86_64\dart-sass\sass.bat C:\Users\ROBINR~1\AppData\Local\Temp\quarto-sessionc20b11b8\e71706c2\b593b6c8.scss C:\Users\ROBINR~1\AppData\Local\Temp\quarto-sessionc20b11b8\e71706c2\sass\397ef2e52d54cf686e4908b90039e9db.css --style compressed --quiet --load-path=C:\Users\RobinRölz\AppData\Local\Programs\Quarto\share\formats\html\bootstrap\dist\scss --load-path=C:\Users\RobinRölz\AppData\Local\Programs\Quarto\share\formats\html\bslib\bslib-scss
(|) Checking basic markdown render....[execProcess] Success: true, code: 0
(/) Checking basic markdown render....Windows: Using code page 1252
[execProcess] C:\Users\RobinRölz\AppData\Local\Programs\Quarto\bin\tools\pandoc +RTS -K512m -RTS --defaults C:\Users\ROBINR~1\AppData\Local\Temp\quarto-sessionc20b11b8\e71706c2\quarto-defaults4dfaa2e0.yml C:\Users\ROBINR~1\AppData\Local\Temp\quarto-sessionc20b11b8\e71706c2\quarto-input7772819d.md --metadata-file C:\Users\ROBINR~1\AppData\Local\Temp\quarto-sessionc20b11b8\e71706c2\quarto-metadatad5cf1eb8.yml --verbose --trace --quiet --data-dir C:\Users\RobinRölz\AppData\Local\Programs\Quarto\share\pandoc\datadir
(-) Checking basic markdown render....[trace] Parsed [Plain [Str "long"]] at line 1
[trace] Parsed [Plain [Str "en"]] at line 1
[trace] Parsed [Plain [Str "true"]] at line 1
[trace] Parsed [Plain [Str "1.4.549"]] at line 1
[trace] Parsed [Plain [Str "Title"]] at line 1
[trace] Parsed [Plain [Str "Table",Space,Str "of",Space,Str "contents"]] at line 1
(\) Checking basic markdown render....[trace] Parsed [] at line 5
[trace] Parsed [Header 2 ("header",[],[]) [Str "Header"]] at line 8
(|) Checking basic markdown render....pandoc: Cannot decode byte '\xf6': Data.Text.Encoding: Invalid UTF-8 stream
[execProcess] Success: false, code: 1
[>] Checking basic markdown render....OK

@cderv
Copy link
Collaborator

cderv commented Feb 23, 2024

@rroelz is the quarto check log complete ?

I am interesting in the log for R (quarto check knitr) which should be part of a global quarto check. It should be after Checking basic markdown render in the log.

Thanks

@rroelz
Copy link
Author

rroelz commented Feb 26, 2024

The checking knitr doesn't execute when calling quarto.exe check. Running it seperately setting

$env:QUARTO_LOG_LEVEL="DEBUG"

gives the following response output:

> quarto.exe check knitr
Quarto version: 1.4.549
Quarto 1.4.549
-- Searching for R binary --
Looking for 'Rscript' in QUARTO_R: undefined
Looking for 'Rscript' in R_HOME: undefined
Looking for 'Rscript' in PATH.
[execProcess] CMD /C where Rscript
(|) Checking R installation...........[execProcess] Success: true, code: 0
Found in PATH at C:\Users\RobinR�lz\AppData\Local\Programs\R\R-4.3.2\bin\x64\Rscript.exe
[execProcess] C:\Users\RobinR�lz\AppData\Local\Programs\R\R-4.3.2\bin\x64\Rscript.exe --version

++ Error while checking R binary found at C:\Users\RobinR�lz\AppData\Local\Programs\R\R-4.3.2\bin\x64\Rscript.exe
[>] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

[NotebookContext]: Starting Cleanup

So it seems to find R in the path but then can't locate it because of the codepage I imagine

Just to be sure I reran quarto.exe check on debug and normal mode and it indeed does stop after [>] Checking basic markdown render....OK

@cscheid cscheid added this to the Future milestone Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows
Projects
None yet
Development

No branches or pull requests

3 participants