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

Swirl won't load in R Studio #83

Closed
bwkeim opened this issue Feb 17, 2014 · 46 comments
Closed

Swirl won't load in R Studio #83

bwkeim opened this issue Feb 17, 2014 · 46 comments

Comments

@bwkeim
Copy link

bwkeim commented Feb 17, 2014

Hello,
I downloaded swirl using install.packages in R-Studio and when I type library(swirl) I receive the following error message:

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘evaluate’
Error: package or namespace load failed for ‘swirl’

My session info is:

R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252 LC_MONETARY=English_Canada.1252
[4] LC_NUMERIC=C LC_TIME=English_Canada.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] openintro_1.4 plotrix_3.5-2 pwr_1.1.1 stringr_0.6.2 tools_3.0.2

Hopefully you can help,
Bernie

@ncarchedi
Copy link
Member

Please try the following and let us know if it solves your problem:

install.packages("swirl", dependencies=TRUE)
library(swirl)

@bwkeim
Copy link
Author

bwkeim commented Feb 17, 2014

Hi,
Unfortunately that didn't work :-(

@ncarchedi
Copy link
Member

We can be more helpful if you copy and paste your exact input and output, so we can see what's happening. Try this:

install.packages("evaluate")
library(swirl)

@WilCrofter
Copy link
Contributor

The diagnostic says it's trying to load package 'evaluate' which it can't find locally. Installing it may help.

Package evaluate is maintained by Yihui Xie, and is a dependency of knitr. Most of us probably have knitr, hence evaluate, installed. I can't see why it should be a dependency of swirl, however.

@ncarchedi
Copy link
Member

evaluate is also a dependency of testthat, which swirl imports. Installing evaluate directly should help. See tidyverse/ggplot2#540.

@bwkeim
Copy link
Author

bwkeim commented Feb 18, 2014

Hi Nick,
The evaluate install did the trick.
Many thanks,
Bernie

@bwkeim bwkeim closed this as completed Feb 18, 2014
@justincherveny
Copy link

I did both of ncarchedi's recommendations

install.packages("evaluate")
library(swirl)

and

install.packages("swirl", dependencies=TRUE)
library(swirl)

and I still get the same error:

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘yaml’
Error: package or namespace load failed for ‘swirl’

Anything else I should try?

  • Justin

@ncarchedi
Copy link
Member

Just responded here: #190

@FKrauss
Copy link

FKrauss commented Feb 16, 2015

Saw the same thing here... the way was to install each package that it depended on individually. I got the following and it worked (meaning: i got the swirl welcome message):
install.packages("evaluate")
install.packages("codetools")
install.packages("testthat")
install.packages("swirl")

@ncarchedi
Copy link
Member

In general, install.packages() should handle package dependencies, but you can try adding the argument dependencies = TRUE in the future.

On Feb 16, 2015, at 6:48 AM, FKrauss notifications@github.com wrote:

Saw the same thing here... the way was to install each package that it depended on individually. I got the following and it worked (meaning: i got the swirl welcome message):
install.packages("evaluate")
install.packages("codetools")
install.packages("testthat")
install.packages("swirl")


Reply to this email directly or view it on GitHub.

@TheSchmidtsu
Copy link

After numerous attempts installing 'swirl' getting a nonzero on install (which means an error)
I already had installed 'Ilibcurl4-openssl-dev' using apt
already had installed the packages inside R for 'evaluate', 'codetools' and
I tried installing 'testthat'
which gave this error package ‘testthat’ is not available (for R version 3.0.2)
The following fixed this problem for me (Linuxmint 17 which uses Ubuntu Trusty repos)
Installing 'r-cran-testthat' using apt

@svicente99
Copy link

I got stuck in these some points described above by peers.
I installed 'evaluate', "codetools"... I tried to install swirl with dependencies=TRUE. Nothing!!
Same error message:
ERROR: dependency ‘testthat’ is not available for package ‘swirl’
What's going on? Is it really possible to use "swirl" in Linux Mint 17 distro? I don't like to come back to Windows only to solve this part of R practices... Sad.

@WilCrofter
Copy link
Contributor

Yes, it is really possible to use "swirl" in Linux Mint 17 distro. I do, for instance.

I'm not sure what's going on with your system, but people do have trouble with Hadley's packages (testthat) from time to time. Make sure all the imports and dependencies are intstalled.

@gngdhr
Copy link

gngdhr commented Jul 7, 2015

Based on the requirements for testthat, testthat requires R 3.1.0 atleast and looks like you are using R 3.0.2. Can you consider upgrading R to 3.1+. The latest is 3.2.

Linux Mint 17 comes with R 3.0 by default. You will need to upgrade R to 3.2. You can follow the instructions provided here.

Hope this helps.

@massimolai80
Copy link

I had the same problem on Linux Mint 17.1 (Rebecca), using R 3.0.2, but I found a workaround.

For some reason, install.packages() could not handle the dependencies correctly (even with the dependencies=True option).

However, as reported by others, the installation works perfectly after installing the evaluate, codetools and testthat packages using apt or synaptic (both seem to handle the dependencies well... as usual):

sudo apt-get install r-cran-evaluate
sudo apt-get install r-cran-codetools
sudo apt-get install r-cran-testthat

I also had to run rstudio as superuser (for the installation directory to be writable)

sudo rstudio

And then, from the R interpreter,

install.packages("swirl")

@diegodondiego
Copy link

Hi, I also had the same problem. My SO is Ubuntu 14.04 LTS. I just followed the instructions from @massimolai80 and swirl is now working.

The only difference is that I think that is not necessary to run rstudio as sudo. I didn't need to do that.

@josephinegiaimo
Copy link

I said yes to installing on a personal library and now I have to pick an HTTPS CRAN mirror. Why?

@seankross
Copy link
Member

Hi @josephinegiaimo,

What country are you located in? Your geographic location is usually a good indicator of what CRAN mirror you should use.

@shwetamrit
Copy link

HI, i am also not able to load swirl,it showing errors,plz help me

install.packages("swirl", dependencies=TRUE)
Installing package into ‘C:/Users/Shweta/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'http://ftp.iitm.ac.in/cran/bin/windows/contrib/3.2/swirl_2.2.21.zip'
Content type 'application/zip' length 132378 bytes (129 KB)
downloaded 129 KB

package ‘swirl’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Shweta\AppData\Local\Temp\Rtmpsngb6l\downloaded_packages

library(swirl)
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘R6’
Error: package or namespace load failed for ‘swirl’
install.packages("evaluate")
Installing package into ‘C:/Users/Shweta/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)

@seankross
Copy link
Member

@shwetamrit

Try:

install.packages("R6")
swirl()

Please let me know if that works.

@KVSRPVARMA
Copy link

image

@KVSRPVARMA
Copy link

pls help me to come out of this error while installing swirl in R studio

@seankross
Copy link
Member

@KVSRPVARMA Are you using an internet connection at work or school? There seems to be an issue with your connection.

@KVSRPVARMA
Copy link

Thanks

Regards,

Dr. Varma

On Sun, May 8, 2016 at 7:20 AM, Sean Kross notifications@github.com wrote:

@KVSRPVARMA https://github.com/KVSRPVARMA Are you using an internet
connection at work or school? There seems to be an issue with your
connection.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#83 (comment)

Dr. K.V.S.R.P.VARMA
Assistant Professor,
Dept.Of. Computer Science & Engineering,
GIT,GITAM UNIVERSITY,
Visakhapatnam-530045

@ghost
Copy link

ghost commented Aug 16, 2016

Many thanks @ncarchedi . That worked for me

@jfdn
Copy link

jfdn commented Oct 4, 2016

Hi

I get the following message when I am trying to run swirl. Does any one have a solution for this?

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘R6’
Error: package or namespace load failed for ‘swirl’

Thanks
Darun

@seankross
Copy link
Member

Hi @jfdn,

What do you get as the result of sessionInfo()?

@jfdn
Copy link

jfdn commented Oct 7, 2016

Also when i try to load through packages i get;

library("swirl", lib.loc="\orunet/dfs/home05/jfdn/my documents/R/win-library/3.3")
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘R6’
Error: package or namespace load failed for ‘swirl’

@seankross
Copy link
Member

Hi @jfdn,

Are you using a computer that belongs to your workplace or school? What do you get as the result of sessionInfo() ?

@jfdn
Copy link

jfdn commented Oct 13, 2016

Hi @seankross
That is the problem I think, the computer belongs to my workplace.
I had someone look at it and came to the same conclusion. He changed something but i don´t now what.

this is what i get when I run, sessionInfo()

R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=Swedish_Sweden.1252 LC_CTYPE=Swedish_Sweden.1252 LC_MONETARY=Swedish_Sweden.1252
[4] LC_NUMERIC=C LC_TIME=Swedish_Sweden.1252

attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base

other attached packages:
[1] ctsem_1.1.6 OpenMx_2.6.9 Rcpp_0.12.7 Matrix_1.2-7.1 MASS_7.3-45 digest_0.6.10

loaded via a namespace (and not attached):
[1] tools_3.3.1 grid_3.3.1 lattice_0.20-33

Best
Darun

@seankross
Copy link
Member

Are you still having the same issue after the change?

@jfdn
Copy link

jfdn commented Oct 14, 2016

Hi @seankross

No, it´s working fine right now.

Thank you for your time.

Best
Darun

@SabriJamal
Copy link

I had the same problem where it constantly told me that swirl package does not exist when running library(swirl) after install.packages("swirl"). If you are running ubuntu 14.04 i can advise you that the following instructions worked

https://github.com/swirldev/swirl/wiki/Installing-swirl-on-Linux

Basically the problem (at least for me) was that the curl package which is used to download packages from the internet was not downloaded.

Hope it helps
Best regards
Sabri Jamal

@tariqulhoda
Copy link

Hello I am getting following error while installing swirl from library.

library(swirl)
Error in parse(n = -1, file = file, srcfile = NULL, keep.source = FALSE) :
1:1: unexpected $end
Error : unable to load R code in package ‘R6’
Error: package or namespace load failed for ‘swirl’

@HudsonShi
Copy link

System: win 10 64
R: 3.32
When I was installing swirl package

local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)

  • if(nchar(pkg)) library(pkg, character.only=TRUE)})
    Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
    there is no package called ‘bitops’
    Error: package or namespace load failed for ‘swirl’

How to fix it?

@seankross
Copy link
Member

@tariqulhoda that's a really bizarre error, are you sure you have the latest version of R installed?

@tariqulhoda
Copy link

tariqulhoda commented Feb 13, 2017

That's right Sean, I even reinstalled the programmer but the result give me the same. :(

R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit) this is the version which i installed.

@seankross
Copy link
Member

@tariqulhoda can you try install.packages("R6") on its own?

@ravivissa
Copy link

I am unable to use Swirl in R.

When I install Swirl --> it shows successfully unpacked. But when I call the library then following is the error


Error: package or namespace load failed for ‘swirl’ in FUN(X[[i]], ...):
no such symbol R_curl_BinaryData_new in package C:/Program Files/R/R-3.4.0/library/RCurl/libs/x64/RCurl.dll
In addition: Warning message:
package ‘swirl’ was built under R version 3.4.1


Any inputs please.

@Nidhitandon
Copy link

Try the following, might work -
install.packages("bitops")
library(swirl)

@ravivissa
Copy link

Thanks Nidhitandon for the response. I figured out that I had two R versions in my office laptop. R studio was downloading the packages in old version of R which is outdated(blocked by internal IT) so was unable to use the library when called. Well figured out the same after few hours of diagnosis with the support team. :-)
Thanks once again for the response

@subbro
Copy link

subbro commented Jun 24, 2018

Hi I am trying to install swirl, but I get the error permission denied.
Below is the response:

install.packages("swirl")
Installing package into ‘C:/Users/xcxcxc/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘cli’, ‘crayon’, ‘praise’, ‘rlang’, ‘withr’, ‘bitops’, ‘stringr’, ‘testthat’, ‘yaml’, ‘RCurl’

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/cli_1.0.0.zip'
Content type 'application/zip' length 329574 bytes (321 KB)
downloaded 321 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/crayon_1.3.4.zip'
Content type 'application/zip' length 749540 bytes (731 KB)
downloaded 731 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/praise_1.0.0.zip'
Content type 'application/zip' length 19449 bytes (18 KB)
downloaded 18 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/rlang_0.2.1.zip'
Content type 'application/zip' length 821556 bytes (802 KB)
downloaded 802 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/withr_2.1.2.zip'
Content type 'application/zip' length 150374 bytes (146 KB)
downloaded 146 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/bitops_1.0-6.zip'
Content type 'application/zip' length 38625 bytes (37 KB)
downloaded 37 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/stringr_1.3.1.zip'
Content type 'application/zip' length 194722 bytes (190 KB)
downloaded 190 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/testthat_2.0.0.zip'
Content type 'application/zip' length 1593521 bytes (1.5 MB)
downloaded 1.5 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/yaml_2.1.19.zip'
Content type 'application/zip' length 190793 bytes (186 KB)
downloaded 186 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/RCurl_1.95-4.10.zip'
Content type 'application/zip' length 2969339 bytes (2.8 MB)
downloaded 2.8 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/swirl_2.4.3.zip'
Content type 'application/zip' length 344405 bytes (336 KB)
downloaded 336 KB

Error in install.packages : cannot open file 'C:/Users/sxcxc/Documents/R/win-library/3.5/file3970562d17a0/cli/help/figures/box-1.png': Permission denied

Could any one help

@MercyMarkus
Copy link

I fixed my issue by updating the Swirl packages in RStudio. I hope this solves your issue.

screenshot from 2018-08-14 11-15-42
screenshot from 2018-08-14 11-15-46

@SQL-realname
Copy link

Hello. This is the error msg I got. I appreciate anyone can help!

Error: package or namespace load failed for ‘swirl’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/digest/libs/digest.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/digest/libs/digest.so, 6): Symbol not found: ___cxa_uncaught_exceptions
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libc++.1.dylib
Expected in: /usr/lib/libc++abi.dylib
in /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libc++.1.dylib

@SQL-realname
Copy link

Hi Here is the error I got below. I appreciate your help!

library("swirl")
Error: package or namespace load failed for ‘swirl’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/digest/libs/digest.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/digest/libs/digest.so, 6): Symbol not found: ___cxa_uncaught_exceptions
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libc++.1.dylib
Expected in: /usr/lib/libc++abi.dylib
in /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libc++.1.dylib

library(swirl)
Error: package or namespace load failed for ‘swirl’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/digest/libs/digest.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/digest/libs/digest.so, 6): Symbol not found: ___cxa_uncaught_exceptions
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libc++.1.dylib
Expected in: /usr/lib/libc++abi.dylib
in /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libc++.1.dylib

Before that, I have done

install.packages("swirl")
install.packages("bitops")
install.packages("R6")
install.packages("evaluate")
install.packages("swirl", dependencies=TRUE)

This is what I have when I typed:

sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.1

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base

loaded via a namespace (and not attached):
[1] compiler_3.6.3 tools_3.6.3 RCurl_1.98-1.2 bitops_1.0-6

@Djamel02
Copy link

If you're using Ubuntu as OS, try to install these packages

  • libcurl4-openssl-dev
  • libssl-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests