I am trying to download packages for R script via python.
Everything works fine and the packages are downloading correctly but for each package I receive errors:
My question is, how can I force python to ignore those errors and not show them?
1 2 3 4 5 6 7 8 |
import rpy2.robjects as robjects data = robjects.r( 'if(!require(rmarkdown)) { install.packages("rmarkdown", repos = "https://cran.revolutionanalytics.com"); require(rmarkdown)}' ) data = robjects.r( 'if(!require(installr)) { install.packages("installr", repos = "https://cran.revolutionanalytics.com"); require(installr)}' ) data = robjects.r( 'if(!require(DT)) { install.packages("DT", repos = "https://cran.revolutionanalytics.com"); require(DT)}' ) data = robjects.r( 'if(!require(lubridate)) { install.packages("lubridate", repos = "https://cran.revolutionanalytics.com"); require(lubridate)}' ) data = robjects.r( 'if(!require(ggplot2)) { install.packages("ggplot2", repos = "https://cran.revolutionanalytics.com"); require(ggplot2)}' ) data = robjects.r( 'if(!require(crayon)) { install.packages("crayon", repos = "https://cran.revolutionanalytics.com"); require(crayon)}' ) |
1 2 3 4 5 6 7 8 9 10 11 |
From cffi callback <function _consolewrite_ex at 0x0000000004D57670 >: Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\rpy2\rinterface_lib\callbacks.py" , line 132 , in _consolewrite_ex s = conversion._cchar_to_str_with_maxlen(buf, n, _CCHAR_ENCODING) File "C:\ProgramData\Anaconda3\lib\site-packages\rpy2\rinterface_lib\conversion.py" , line 133 , in _cchar_to_str_with_maxlen s = ffi.string(c, maxlen).decode(encoding) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 0 : invalid start byte From cffi callback <function _consolewrite_ex at 0x0000000004D57670 >: Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\rpy2\rinterface_lib\callbacks.py" , line 132 , in _consolewrite_ex s = conversion._cchar_to_str_with_maxlen(buf, n, _CCHAR_ENCODING) |