Cannot install IRkernel with install_github(): Git not installed?
Solution 1
Thought I would chime in here. I had the exact same problem. I came across this post...https://github.com/IRkernel/IRkernel/issues/594 where Flying Sheep simply states to install git. So went to https://git-scm.com/ and downloaded and installed, then ran the instructions https://irkernel.github.io/installation/ and everything worked. Now using R in Jupyter Nb.
Solution 2
Here a way to overcome this problem. I have installed IRkernel with anaconda in my mac (I guess is the same on Linux and Windows) I typed:
conda install -c r r-irkernel
Then I started started R from terminal by typing:
R
Finally, I have install the kernelspec to tell Jupyter about IRkernel, with the option user=FALSE for installation in the global environment:
IRkernel::installspec(user=FALSE)
Hope it helps!
Solution 3
I had the same problem on Windows 7 and found older versions of devtools package work out. I downloaded devtools_1.13.4.tar.gz(didn't test others) from https://cran.r-project.org/src/contrib/Archive/devtools/,and did as follows:
-
install devtools_1.13.4.tar.gz from local:
go into R, click on Packages (at the top of the R console), then click on "Install package(s) from local zip files" and install the devtools_1.13.4.tar.gz, an ERROR message shows which dependencies are in need, for me, the message was :
ERROR: dependencies 'httr', 'memoise', 'whisker', 'digest', 'rstudioapi', 'jsonlite', 'git2r', 'withr' are not available for package 'devtools'.
-
install these dependecies:
install.packages(c('httr', 'memoise', 'whisker', 'digest', 'rstudioapi', 'jsonlite', 'git2r', 'withr'))
- reinstall devtools_1.13.4.tar.gz from local;
-
execute:
library('devtools') install_github('IRkernel/IRkernel') IRkernel::installspec()
If message shows up like:
Error in IRkernel::installspec():jupyter-client has to be installed but “jupyter kernelspec --version” exited with code 127.
run R.exe from within Anaconda prompt,and execute:
IRkernel::installspec()
and everything worked.
Solution 4
i combined the two of the solutions given above and that worked for me , from R console none were working, now it is working so thanks to the two above contributors.
1- go in anaconda prompt and runconda install -c r r-irkernel
2- Now in anaconda prompt type R.exe
3- now run this command IRkernel::installspec()
and it worked`
Solution 5
I suspect that the tutorial linked to by the OP has changed.
I get the same error when following the IRkernel installation instructions here, however:
install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
devtools::install_github('IRkernel/IRkernel')
IRkernel::installspec()
That's despite having Git installed.
Using the following works, though:
install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
install.packages('IRkernel')
IRkernel::installspec()
(Those are similar to the instructions that now feature on the tutorial linked to by the OP.)
user190080
Here is a small starter guide to MathJax, which I find quite helpful from time to time: MathJax basic tutorial and quick reference
Updated on June 12, 2022Comments
-
user190080 almost 2 years
I was trying to get R working with the Jupyter Notebook on my Windows machine. I followed the IRkernel tutorial. However, I can't install the GitHub repository, I always get the error
install_github("IRkernel/IRkernel") Downloading GitHub repo IRkernel/IRkernel@master Error: Git does not seem to be installed on your system.
The devtools package (2.0.1) is installed. install_github also works for example with install_github("StatsWithR/statsr") (Coursera package) (although the devtools package is not even loaded?).
Not sure how to deal with the problem, any ideas? Is my devtools package broken?
Update: Just performed a re-installation of R (deleted all packages): I still get the same error
-
user190080 over 5 yearsDid you experience the same error though? Did you also install: conda install -c r r-essentials?
-
paoloeusebi over 5 yearsNo I have experienced other issues. Did you have Git installed?
-
user190080 over 5 yearsActually the devtools package should provide everything necessary...that's at least what I've thought so far. It also works with other GitHub packages so it's a bit weird
-
user190080 over 5 yearsBut isn't that extremely strange? Git itself is nowhere listed as a requirement, I thought that everything is piped though devtools aka install_github...?!
-
user190080 over 5 yearsInstalled Git, it worked! Now I am stuck with the IRkernel::installspec(), did this work for you?