Error in .read_description(dfile) : DESCRIPTION does not exist

I am on WIN 10 and I suspect it is due to polish character in my user profile folder. Even though i am using:
Sys.setlocale(category = "LC_ALL", locale = "Polish")
I suspect installation fails, since it can't read the Polish character correctly. I encountered this issue when I installed a new R version. I have already tried clean reinstall for 4.0.3 and 4.0.2 (I had no issues before on 4.0.2). Right now I cannot install packages that I previously managed to successfully install on 4.0.2 due to error described below.

Do you also believe that this is due to character in my name or could it be another reason?

I started a fresh session as an administrator and the issue does not occur for all packages. Packages that I have identified so far: raster, here, rprojroot. It also seems that the issue occurs for packages when they are installed from the "source" (not binary) and that need compilation.


> install.packages("raster")

  There is a binary version available but the source version is later:
       binary source needs_compilation
raster 3.3-13  3.4-5              TRUE

installing the source package ‘raster’

trying URL 'https://cran.rstudio.com/src/contrib/raster_3.4-5.tar.gz'
Content type 'application/x-gzip' length 575921 bytes (562 KB)
downloaded 562 KB

* installing *source* package 'raster' ...
** package 'raster' successfully unpacked and MD5 sums checked
** using staged installation
Error in .read_description(dfile) : 
	•   file 'C:/Users/Bart³omiej/AppData/Local/Temp/Rtmp8oARfm/R.INSTALL4f4010567bff/raster/DESCRIPTION' does not exist
ERROR: installing package DESCRIPTION failed for package 'raster'
* removing 'C:/Program Files/R/R-4.0.3/library/raster'
* restoring previous 'C:/Program Files/R/R-4.0.3/library/raster'
Warning in install.packages :
  installation of package ‘raster’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\Bart³omiej\AppData\Local\Temp\RtmpYppZKp\downloaded_packages’
Warning messages:
1: In load(cacheFile, envir = .rs.CachedDataEnv) :
  strings not representable in native encoding will be translated to UTF-8
2: In load(cacheFile, envir = .rs.CachedDataEnv) :
  strings not representable in native encoding will be translated to UTF-8
> Sys.setlocale(category = "LC_ALL", locale = "Polish")
[1] "LC_COLLATE=Polish_Poland.1250;LC_CTYPE=Polish_Poland.1250;LC_MONETARY=Polish_Poland.1250;LC_NUMERIC=C;LC_TIME=Polish_Poland.1250"
> install.packages("raster")

  There is a binary version available but the source version is later:
       binary source needs_compilation
raster 3.3-13  3.4-5              TRUE

installing the source package ‘raster’

trying URL 'https://cran.rstudio.com/src/contrib/raster_3.4-5.tar.gz'
Content type 'application/x-gzip' length 575921 bytes (562 KB)
downloaded 562 KB

* installing *source* package 'raster' ...
** package 'raster' successfully unpacked and MD5 sums checked
** using staged installation
Error in .read_description(dfile) : 
  file 'C:/Users/Bartłomiej/AppData/Local/Temp/Rtmp6dXzVp/R.INSTALL2804cde12aa/raster/DESCRIPTION' does not exist
ERROR: installing package DESCRIPTION failed for package 'raster'
* removing 'C:/Program Files/R/R-4.0.3/library/raster'
* restoring previous 'C:/Program Files/R/R-4.0.3/library/raster'
Warning in install.packages :
  installation of package ‘raster’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\Bartłomiej\AppData\Local\Temp\RtmpYppZKp\downloaded_packages’
	
	
> install.packages("rprojroot")

  There is a binary version available but the source version is later:
          binary source needs_compilation
rprojroot  1.3-2  2.0.2             FALSE

installing the source package ‘rprojroot’

trying URL 'HERE IS CORRECT LINK' <- THE SITE DID NOT ALLOW TO PUT MORE THAN 2 LINKS IN POST
Content type 'application/x-gzip' length 59967 bytes (58 KB)
downloaded 58 KB

* installing *source* package 'rprojroot' ...
** package 'rprojroot' successfully unpacked and MD5 sums checked
** using staged installation
Error in .read_description(dfile) : 
  file 'C:/Users/Bartłomiej/AppData/Local/Temp/RtmpCKcZEB/R.INSTALL3dc44c486ca8/rprojroot/DESCRIPTION' does not exist
ERROR: installing package DESCRIPTION failed for package 'rprojroot'
* removing 'C:/Program Files/R/R-4.0.3/library/rprojroot'
* restoring previous 'C:/Program Files/R/R-4.0.3/library/rprojroot'
Warning in install.packages :
  installation of package ‘rprojroot’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\Bartłomiej\AppData\Local\Temp\RtmpYppZKp\downloaded_packages’

Yes, that is most likely the reason. R is having troubles with non-ASCII characters in your windows user name, either change your username to something safer or install into the system-level package library instead.

You can change the defaul folder by setting your R_LIBS_SITE environmental variable on a .Reviron or .Rprofile file

# In .Renviron file you can set it by adding this line
R_LIBS_SITE="C:\\Program Files\\R\\R-4.0.3\\library"

For a more detailed explanation, you can read this blog post

Thank you for the prompt reply.

Actually, the library is already specifed as you mentioned in
"C:\Program Files\R\R-4.0.3\library". However it seems that the issue is with unpacking downloaded packages in temporary folders. R is somehow able to save files that but it is not able retrieve all of them. I checked the path that it mentions, for instance: ```
C:/Users/Bart³omiej/AppData/Local/Temp/Rtmp8oARfm/R.INSTALL4f4010567bff/raster/DESCRIPTION
and the following path does not exist.

Unfortunately, I am not able to access .Renviron file, since R cannot open the path, since it encounteres the same issue. It can't read polish characters. Is is possible to set it different way?

These are results from the command that you have mentioned:

Sys.getenv(c("TMPDIR","TEMP","TMP","R_USER"))
TMPDIR
"" "
TEMP
C:\Users\BARTOM~1\AppData\Local\Temp"

TMP
"C:\Users\BARTOM~1\AppData\Local\Temp"
R_USER
"C:/Users/Bart?omiej/Documents"

This is screenshot from environment settings:
obraz

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

temporary directories are typically access within R via tempdir().
The documnetation for tempdir() explains how the root path is decided.

By default, tmpdir will be the directory given by tempdir(). This will be a subdirectory of the per-session temporary directory found by the following rule when the R session is started. The environment variables TMPDIR, TMP and TEMP are checked in turn and the first found which points to a writable directory is used: if none succeeds the value of R_USER (see Rconsole) is used.

Therefore I suggest that the first step is gathering info about what is set in your R environment.
e.g. do:

Sys.getenv(c("TMPDIR","TEMP","TMP","R_USER"))

I think these wil have been populated by corresponding windows 'Environment Settings'
In a windows command (cmd) console you can peek at them like

echo %TEMP%

I believe these correspond directly to Windows - Settings - Environment Variables

If I were in your shoes I might experiment with making a temporary folder like C:\mytemp
and edit environment settings to use that, and see what effect it has