I try to run locally this repository
I installed git but when I run this command:
sh requirements.sh
I receive this error:
$ sh requirements.sh
Java is installed
which: no C:Program in (/c/Users/Username/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/Username/bin:/c/Perl64/site/bin:/c/Perl64/bin:/c/ProgramData/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program
Files/Java/jre1.8.0_151/bin:/c/Program
Files/Java/jre1.8.0_151:/c/WINDOWS/System32/OpenSSH:/c/Program Files
(x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program
Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program
Files/Intel/WiFi/bin:/c/Program Files/Common
Files/Intel/WirelessCommon:/c/Program Files/Git
LFS:/cmd:/mingw64/bin:/usr/bin:/c/Program Files/R/R-3.5.2:/c/Program
Files/R/R-3.5.2/bin:/c/Program
Files/R/R-3.5.2/bin/Rscript.exe:/c/Users/Username/AppData/Local/Microsoft/WindowsApps:/c/Program
Files/Docker Toolbox:/usr/bin/vendor_perl:/usr/bin/core_perl)
which: no FilesRR-3.5.2binR in (/c/Users/Username/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/Username/bin:/c/Perl64/site/bin:/c/Perl64/bin:/c/ProgramData/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program
Files/Java/jre1.8.0_151/bin:/c/Program
Files/Java/jre1.8.0_151:/c/WINDOWS/System32/OpenSSH:/c/Program Files
(x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program
Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program
Files/Intel/WiFi/bin:/c/Program Files/Common
Files/Intel/WirelessCommon:/c/Program Files/Git
LFS:/cmd:/mingw64/bin:/usr/bin:/c/Program Files/R/R-3.5.2:/c/Program
Files/R/R-3.5.2/bin:/c/Program
Files/R/R-3.5.2/bin/Rscript.exe:/c/Users/Username/AppData/Local/Microsoft/WindowsApps:/c/Program
Files/Docker Toolbox:/usr/bin/vendor_perl:/usr/bin/core_perl)
R is installed
Warning in install.packages(c("caret"), dependencies = c("Imports", "Depends"), :
'lib = "C:/Program Files/R/R-3.5.2/library"' is not writable
Error in install.packages(c("caret"), dependencies = c("Imports", "Depends"), :
unable to install packages
In addition: Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'caret'
Execution halted
Please is there any idea what should I fix in the paths?
Edit
Running another command I receive this error:
MINGW64 /c/git/Senti4SD/ClassificationTask (master)
$ Rscript requirements.R
Warning in install.packages(c("caret"), dependencies = c("Imports", "Depends"), :
'lib = "C:/Program Files/R/R-3.5.2/library"' is not writable
Error in install.packages(c("caret"), dependencies = c("Imports", "Depends"), :
unable to install packages
In addition: Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'caret'
Execution halted
It seems the command line couldn't find the "which" command, which is supplied with mingw.
If you installed Git for Windows, you should try looking for a installed program called "Git bash" and run your script from there.
You should be able to right click the folder and select "open git bash here", if you installed the Explorer extension.
Edit:
Its a problem related to install permission. Try running "Git bash" with Administrative privileges in Windows.
If the bash dont work, run "Rscript requirements.R" directly.
Related
I wanted to use R in visual studio code and so I tried running some basic codes and it worked. But whenever I try to install any package (eg. ggplot2) from the R-Extension in the VsCode I get this error
Installing package into 'C:/Users/krish/Documents/R/win-library/4.1'
(as 'lib' is unspecified) Warning in install.packages(c("ggplot2"),
repos = "https://cran.r-project.org/") : 'lib =
"C:/Users/krish/Documents/R/win-library/4.1"' is not writable Error in
install.packages(c("ggplot2"), repos = "https://cran.r-project.org/")
: unable to install packages Execution halted The terminal process
"C:\Program Files\R\R-4.1.2\bin\R.exe '--silent', '--slave', '-e',
'install.packages(c('ggplot2'),repos='https://cran.r-project.org/')'"
terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
I have added r-library and r bin to env path following some other posts but it is not working.
I am trying to intsall the r interface to keras/tensoflow in R studio following the code bellow:
`install.packages('devtools')
devtools::install_github("rstudio/keras")
devtools::install_github("rstudio/tensorflow")
library(tensorflow)
install_tensorflow(version = "2.8.0")
library(keras)
install_keras()
reticulate::use_condaenv("anaconda3", required = TRUE)`
All things are Ok until install_tensorflow(version = "2.8.0"), the r studio says
No non-system installation of Python could be found. Would you like to download and install Miniconda?
I choose because I want to use the python of my our anaconda environment. But when finishing this command line, it has a warning message
Warning message:
In system2(conda, c("run", in_env, run_args, shQuote(cmd), args),:
running command '"C:/Users/jinhu/anaconda3/condabin/conda.bat"
run --prefix "C:\Users\jinhu\anaconda3" --no-capture-output "python" -c "import os;
print(os.environ['PATH'])"' had status 1
In addition, when I input the py_config function to see the available python version, it output:
Error in Sys.setenv(PATH = new_path) : wrong length for argument In addition: Warning message: In system2(conda, c("run", in_env, run_args, shQuote(cmd), args), : running command '"C:/Users/jinhu/anaconda3/condabin/conda.bat" run --prefix "C:\Users\jinhu\anaconda3\envs\r-reticulate" --no-capture-output "python" -c "import os; print(os.environ['PATH'])"' had status 1
below is my conda list:
conda_list()
name python
base C:\\Users\\jinhu\\anaconda3/python.exe
pytorch C:\\Users\\jinhu\\anaconda3\\envs\\pytorch/python.exe
r-reticulate C:\\Users\\jinhu\\anaconda3\\envs\\r-reticulate/python.exe
tensorflow C:\\Users\\jinhu\\anaconda3\\envs\\tensorflow/python.exe
Here is my conda verson:
(base) C:\Users\jinhu>conda info
active environment : base
active env location : C:\Users\jinhu\anaconda3
shell level : 1
user config file : C:\Users\jinhu\.condarc
populated config files : C:\Users\jinhu\.condarc
conda version : 4.10.3
conda-build version : 3.21.6
python version : 3.9.7.final.0
virtual packages : __cuda=11.4=0
__win=0=0
__archspec=1=x86_64
base environment : C:\Users\jinhu\anaconda3 (writable)
conda av data dir : C:\Users\jinhu\anaconda3\etc\conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\Users\jinhu\anaconda3\pkgs
C:\Users\jinhu\.conda\pkgs
C:\Users\jinhu\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\jinhu\anaconda3\envs
C:\Users\jinhu\.conda\envs
C:\Users\jinhu\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.10.3 requests/2.26.0 CPython/3.9.7 Windows/10 Windows/10.0.22000
administrator : False
netrc file : None
offline mode : False
Also when I try use_condaenv( "r-reticulate"), it shows:
`Error in Sys.setenv(PATH = new_path) : wrong length for argument In addition: Warning message: In system2(conda, c("run", in_env, run_args, shQuote(cmd), args), : running command '"C:/Users/jinhu/anaconda3/condabin/conda.bat" run --prefix "C:\Users\jinhu\anaconda3\envs\r-reticulate" --no-capture-output "python" -c "import os; print(os.environ['PATH'])"' had status 1`
I think the question is new-created r-reticulate environment cannot find the available python, what should I do to solve it?
I am trying to install a package ver. developer from github, which requires to update the ps and processx packages. RStudio is running in administrative mode in Windows 10 and the environment is empty. Moreover, both ps and processx packages are not loaded. But, I am still getting an error i.e. permission denied. I tried a solution mentioned here, but it doesn't work, how can this be fixed?
Warning messages:
1: In file.copy(savedcopy, lib, recursive = TRUE) :
problem copying C:\Users\ABC\OneDrive\Documents\R\win-library\4.0\00LOCK\ps\libs\x64\ps.dll to C:\Users\ABC\OneDrive\Documents\R\win-library\4.0\ps\libs\x64\ps.dll: Permission denied
2: In file.copy(savedcopy, lib, recursive = TRUE) :
problem copying C:\Users\ABC\OneDrive\Documents\R\win-library\4.0\00LOCK\processx\libs\x64\processx.dll to C:\Users\ABC\OneDrive\Documents\R\win-library\4.0\processx\libs\x64\processx.dll: Permission denied
After updating R to 4.0.3 and RStudio to the newest version, I have issues with the cointegration of RStudio and RTools described in these questions (before R was 3.6 and RTools 35 and everything worked fine):
https://community.rstudio.com/t/problems-with-r-4-0-0-windows-error-package-or-namespace-load-failed-for-stats-in-indl-x-as-logical-local-as-logical-now/62958/6
https://community.rstudio.com/t/rtools-not-found-after-r-4-0-0-installation/63356/3
I found that I should set some environmental variables for my user. However, I do not understand how to do it, despite the fact that the new path to RTolls should have path C:\rtools40\usr\bin (with older Rtools version it is C:\RTools\bin. Could you help with that?
Additionally,I did these steps, but then got error when downloading package
> Sys.setenv(PATH = paste("C:/rtools40/usr/bin", Sys.getenv("PATH"), sep=";"))
> install_github("brettjbush/R-Websockets")
Downloading GitHub repo brettjbush/R-Websockets#HEAD
√ checking for file 'C:\Users\NAME\AppData\Local\Temp\RtmpSMB4KM\remotes2bcc582622c6\brettjbush-R-Websockets-fc7ee9c/DESCRIPTION' (598ms)
- preparing 'websockets':
√ checking DESCRIPTION meta-information ...
- cleaning src
Warning in system2(command, args, stdout = NULL, stderr = NULL, ...) :
'CreateProcess' failed to run 'C:\rtools40\usr\bin\make.exe -f "C:/PROGRA~1/R/R-40~1.3/share/make/clean.mk" -f Makevars.win clean'
Then I tried following and got different error
> Sys.setenv(PATH = paste("C:/rtools40/usr/bin", Sys.getenv("PATH"), sep=";"))
> Sys.setenv(BINPREF = "C:/rtools40/mingw_$(WIN)/bin/")
> install_github("brettjbush/R-Websockets")
Downloading GitHub repo brettjbush/R-Websockets#HEAD
brettjbush-R-Websockets-fc7ee9c/man/websocket_close.Rd: truncated gzip input
tar.exe: Error exit delayed from previous errors.
Error: Failed to install 'websockets' from GitHub:
Does not appear to be an R package (no DESCRIPTION)
In addition: Warning messages:
1: In utils::untar(tarfile, ...) :
‘tar.exe -xf "C:\Users\NAME\AppData\Local\Temp\RtmpSMB4KM\file2bccd21558.tar.gz" -C "C:/Users/NAME/AppData/Local/Temp/RtmpSMB4KM/remotes2bcc2b6a75d4"’ returned error code 1
2: In system(cmd, intern = TRUE) :
running command 'tar.exe -tf "C:\Users\NAME\AppData\Local\Temp\RtmpSMB4KM\file2bccd21558.tar.gz"' had status 1
The following is the error i received:
Loading required package: tmap
Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called ‘tmap’
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages(p) :
'lib = "/usr/local/lib/R/site-library"' is not writable
Error in value[[3L]](cond) : unable to install packages
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
The following is my code:
packages = c('tmap', 'sf', 'tidyverse', 'RColorBrewer', 'classInt',
'raster', 'sp', 'REAT', 'SpatialAcc', 'shiny', 'leaflet', 'factoextra',
'NbClust')
for(p in packages){
if(!require(p, character.only = T)){
install.packages(p)
}
library(p, character.only = T)
}
What could be the problem?.
I tried deploying through the following command in rstudio.
library(rsconnect)
rsconnect::deployApp('D:/student/mypath')
The issue is that shinyapps.io doesn't let you install R packages on their server. Allowing that would not really make sense for security reasons so please don't try to "hack" your way into an installation.
Instead file an issue (or a PR) on the github repo shinyapps dependencies and ask them to support your missing packages.
A second solution is to purchase a server and set up shiny-server yourself. Then you will be free to install packages at will. Instructions about that can be found here.
Edit: Actually, it seems custom libraries are supported on shinyapps.io and they will be installed automatically based on your library and require calls. So you probably just need to remove the ìnstall.packages part in your uploaded app.
When you deploy your application, the rsconnect package attempts to detect the packages that your application uses. rsconnect sends this list of packages and their dependencies along with your application to the shinyapps.io service. Then shinyapps.io builds and installs the packages into the R library for your application. The first time you deploy your application, it may take some time to build these packages (depending on how many packages are used). However, you will not wait for these packages to build during future deployments (unless you upgrade or downgrade a package)
-- Shinyapps.io - Getting started