Installing tidymodels package to dig into #tidytuesday

Hi there, I am attempting to recreate the wonderful work of Julia Silge for #TidyTuesday and the astronaut missions.

I will preface this by writing that I am genuinely curious about understanding the underlying issues so I may troubleshoot these issues independently in the future, and help others as well.

As I am attempting to install the tidymodels package I encounter the message below. It seems the errors arise when attempting to compile rlang, tibble, and yardstick.

I am using the most recent versions of R and R Studio, which I'm unsure is a good or bad thing frankly.

> install.packages("tidymodels")
also installing the dependencies ‘rlang’, ‘tibble’, ‘yardstick’


  There are binary versions available but the source versions are later:
           binary source needs_compilation
rlang       0.4.6  0.4.7              TRUE
tibble      3.0.2  3.0.3              TRUE
yardstick   0.0.6  0.0.7              TRUE
tidymodels  0.1.0  0.1.1             FALSE

installing the source packages ‘rlang’, ‘tibble’, ‘yardstick’, ‘tidymodels’

trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.4.7.tar.gz'
Content type 'application/x-gzip' length 847308 bytes (827 KB)
downloaded 827 KB

trying URL 'https://cran.rstudio.com/src/contrib/tibble_3.0.3.tar.gz'
Content type 'application/x-gzip' length 254549 bytes (248 KB)
downloaded 248 KB

trying URL 'https://cran.rstudio.com/src/contrib/yardstick_0.0.7.tar.gz'
Content type 'application/x-gzip' length 399868 bytes (390 KB)
downloaded 390 KB

trying URL 'https://cran.rstudio.com/src/contrib/tidymodels_0.1.1.tar.gz'
Content type 'application/x-gzip' length 25631 bytes (25 KB)
downloaded 25 KB

* installing *source* package 'rlang' ...
** package 'rlang' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
/mingw32/bin/gcc  -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -I./lib/         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c capture.c -o capture.o
      0 [main] make 966 dofork: child -1 - forked process 51048 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
make: fork: Resource temporarily unavailable
ERROR: compilation failed for package 'rlang'
* removing 'C:/Program Files/R/R-4.0.2/library/rlang'
* restoring previous 'C:/Program Files/R/R-4.0.2/library/rlang'
Warning in install.packages :
  installation of package ‘rlang’ had non-zero exit status
* installing *source* package 'tibble' ...
** package 'tibble' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
/mingw32/bin/gcc  -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -std=gnu99         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c attributes.c -o attributes.o
      0 [main] make 1701 child_info_fork::abort: \??\C:\rtools40\usr\bin\msys-intl-8.dll: Loaded to different address: parent(0x600000) != child(0x180000)
make: fork: Resource temporarily unavailable
ERROR: compilation failed for package 'tibble'
* removing 'C:/Program Files/R/R-4.0.2/library/tibble'
* restoring previous 'C:/Program Files/R/R-4.0.2/library/tibble'
Warning in install.packages :
  installation of package ‘tibble’ had non-zero exit status
* installing *source* package 'yardstick' ...
** package 'yardstick' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
/mingw32/bin/gcc  -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG          -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c init.c -o init.o
      0 [main] make 1400 dofork: child -1 - forked process 62276 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
make: fork: Resource temporarily unavailable
ERROR: compilation failed for package 'yardstick'
* removing 'C:/Program Files/R/R-4.0.2/library/yardstick'
* restoring previous 'C:/Program Files/R/R-4.0.2/library/yardstick'
Warning in install.packages :
  installation of package ‘yardstick’ had non-zero exit status
* installing *source* package 'tidymodels' ...
** package 'tidymodels' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace 'rlang' 0.4.6 is being loaded, but >= 0.4.7 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'tidymodels'
* removing 'C:/Program Files/R/R-4.0.2/library/tidymodels'
Warning in install.packages :
  installation of package ‘tidymodels’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\ssaavedra\AppData\Local\Temp\RtmpIzSeUu\downloaded_packages’

Then, when I try to install or update the packages individually, I get the following messages:

 install.packages(c("rlang", "tibble", "yardstick"))

  There are binary versions available but the source versions are later:
          binary source needs_compilation
rlang      0.4.6  0.4.7              TRUE
tibble     3.0.2  3.0.3              TRUE
yardstick  0.0.6  0.0.7              TRUE

installing the source packages ‘rlang’, ‘tibble’, ‘yardstick’

trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.4.7.tar.gz'
Content type 'application/x-gzip' length 847308 bytes (827 KB)
downloaded 827 KB

trying URL 'https://cran.rstudio.com/src/contrib/tibble_3.0.3.tar.gz'
Content type 'application/x-gzip' length 254549 bytes (248 KB)
downloaded 248 KB

trying URL 'https://cran.rstudio.com/src/contrib/yardstick_0.0.7.tar.gz'
Content type 'application/x-gzip' length 399868 bytes (390 KB)
downloaded 390 KB

* installing *source* package 'rlang' ...
** package 'rlang' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
/mingw32/bin/gcc  -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -I./lib/         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c capture.c -o capture.o
      0 [main] make (56988) C:\rtools40\usr\bin\make.exe: *** fatal error - cygheap base mismatch detected - 0x1D06408/0x1DA6408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
      0 [main] make 1424 dofork: child -1 - forked process 56988 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
make: fork: Resource temporarily unavailable
ERROR: compilation failed for package 'rlang'
* removing 'C:/Program Files/R/R-4.0.2/library/rlang'
* restoring previous 'C:/Program Files/R/R-4.0.2/library/rlang'
Warning in install.packages :
  installation of package ‘rlang’ had non-zero exit status
* installing *source* package 'tibble' ...
** package 'tibble' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
/mingw32/bin/gcc  -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -std=gnu99         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c attributes.c -o attributes.o
      0 [main] make (61896) C:\rtools40\usr\bin\make.exe: *** fatal error - cygheap base mismatch detected - 0x17B6408/0x14D6408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
      0 [main] make 54 dofork: child -1 - forked process 61896 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
make: fork: Resource temporarily unavailable
ERROR: compilation failed for package 'tibble'
* removing 'C:/Program Files/R/R-4.0.2/library/tibble'
* restoring previous 'C:/Program Files/R/R-4.0.2/library/tibble'
Warning in install.packages :
  installation of package ‘tibble’ had non-zero exit status
* installing *source* package 'yardstick' ...
** package 'yardstick' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
/mingw32/bin/gcc  -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG          -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c init.c -o init.o
      0 [main] make 1429 dofork: child -1 - forked process 54772 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
make: fork: Resource temporarily unavailable
ERROR: compilation failed for package 'yardstick'
* removing 'C:/Program Files/R/R-4.0.2/library/yardstick'
* restoring previous 'C:/Program Files/R/R-4.0.2/library/yardstick'
Warning in install.packages :
  installation of package ‘yardstick’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\ssaavedra\AppData\Local\Temp\RtmpIzSeUu\downloaded_packages’

I've seen lots of great commentary on similar topics from andresrcs, so tagging him in here.

This is what I saw within your post.

1 Like

Also, if you're fine with being a minor version behind for some of those packages, you could answer 'No' when asked if you'd like to install from source and simply install the binaries instead.

1 Like

You seem to be having issues with the 32 bit compiler from RTools40, maybe you haven't installed it correctly. If you don't have a particular reason for also having a 32-bit R installation I would recommend uninstalling it to avoid this issue.

Also, please be aware of this forum policy

1 Like

OK, so it looks like tidymodels absolutely must have the latest version of rlang. Since you're having trouble building from source, I guess the simplest solution would be to wait for CRAN to update the rlang binaries to 0.4.7 (typically happens a few days after a new version has been uploaded).

You can monitor this page for the update by looking under Windows binaries r-release (currently showing as 0.4.6).

1 Like

The rlang version you need is currently only available on source form (a binary will be available later) so you have to compile.

Your issue is not with the 64-bit version, the problem is that when you have both 32 and 64 bit R versions installed in your system, R tries to install the the package for both architectures and you seem to be missing the 32-bit compiler. That is why I recommend you to uninstall the 32 bit R version if you don't strictly need it.

1 Like

Perfect, thank you. And to uninstall the 32-bit version, I am thinking I will simply delete R-4.0.2\bin\i386 out of the R Program Folder parent file. Is this what you'd suggest?

Thank you so much, this is incredibly helpful and I'm learning rapidly. To ensure I'm reading the rlang CRAN page correctly, looking at the below screen grab I'm interpreting the Windows Binaries field to say: "0.4.7 is avail for developers but 0.4.6 is the current official binary release". Is that about how you read that info?

I wouldn't recommend doing it that way you may end up with a corrupted installation, use the Windows utility for that matter.

r-devel means the development version of R and r-release means the current stable release (i.e 4.0.2) which is the one you have installed.

1 Like

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

Thank you very much. I did try this route last night and no cygwin files showed up at all. I will continue searching. Thank you.

Thank you andresrcs, both for the idea and for pointing to me on guidance for @ name mentioning. I certainly did not mean to install a 32-bit version so that's the first thing I will try this morning and I will refrain from unnecessarily mentioning folks. My apologies if that did indeed come across as bad form.

I will report back to this group once I've tried all three solutions.

Ah, thank you for the idea. I will try that this morning and see if that remedies the issues. I appreciate the input.

This seems to potentially be the root of the issue. I selected "No" when asked if I want to install from the source and see this:

installing the source package ‘tidymodels’

trying URL 'https://cran.rstudio.com/src/contrib/tidymodels_0.1.1.tar.gz'
Content type 'application/x-gzip' length 25631 bytes (25 KB)
downloaded 25 KB

* installing *source* package 'tidymodels' ...
** package 'tidymodels' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace 'rlang' 0.4.6 is being loaded, but >= 0.4.7 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'tidymodels'
* removing 'C:/Program Files/R/R-4.0.2/library/tidymodels'
Warning in install.packages :
  installation of package ‘tidymodels’ had non-zero exit status

Seeing "namespace 'rlang' 0.4.6 is being loaded, but >= 0.4.7 is required" makes me think I need to try updating the rland package, though when I go to do so I see:

> install.packages("rlang")

  There is a binary version available but the source version is later:
      binary source needs_compilation
rlang  0.4.6  0.4.7              TRUE

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/rlang_0.4.6.zip'
Content type 'application/zip' length 1117248 bytes (1.1 MB)
downloaded 1.1 MB

package ‘rlang’ successfully unpacked and MD5 sums checked

And upon doing this RStudio is still showing rlang needs to be updated to 0.4.7
image

I tried this all previously as well so I'm not quite sure how to escape this install loop with the final goal of installing tidymodels.

I double-checked and do have 64-bit version of RTools installed and even followed the instructions " to put the location of the Rtools make utilities ( bash , make , etc) on the PATH ."