rPython-win icon indicating copy to clipboard operation
rPython-win copied to clipboard

Install issue with windows 10 (working example)

Open JessQuevza opened this issue 8 years ago • 5 comments

At the beginning (as many of you) I got errors while trying to install the rPython package on my computer. I solve this problems by just adding C:/Rtools (C:/path/to/Rtools) to the variable Path in my system environment variables. After, I restarted the R session and did the following:

> library(devtools)
> install("C:/Programs/rPython")

Installing rPython
"C:/Programs/R-3.4.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL "C:/Programs/rPython"  \
  --library="C:/Programs/R-3.4.2/library" --install-tests 

* installing *source* package 'rPython' ...
** libs
Warning: this package has a non-empty 'configure.win' file, so building only the main architecture make: Nothing to be done for `all'. installing to C:/Programs/R-3.4.2/library/rPython/libs/x64

** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (rPython)

> library(rPython)
Loading required package: RJSONIO

And it worked perfectly! I hope this can help other people having the same issue.

JessQuevza avatar Oct 18 '17 15:10 JessQuevza

Good to know it is actually possible. Since I got it working on a Windows 7 (32-bit) system I thought the Windows 10 64-bit might be the problem. Both were using R version 3.4.2. Maybe you can help me out in getting it work: Which Python version are you using (2.7 or 3.X with 32-/64-bit)? Does it work with anaconda? And is your R 32- or 64-bit? I also added Rtools to the path and I also got a PYTHONHOME/PYTHONPATH system enviromental variable.

R 64-bit results with any Python version in this error:

* installing *source* package 'rPython' ...
** libs
Warnung: this package has a non-empty 'configure.win' file,
so building only the main architecture

make: Nothing to be done for `all'.
installing to C:/Users/jawach/Documents/R/win-library/3.4/rPython/libs/x64
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for 'rPython':
 .onLoad failed in loadNamespace() for 'rPython', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error: kann shared object 'C:/Users/jawach/Documents/R/win-library/3.4/rPython/libs/x64/rPython.dll' nicht laden:
  LoadLibrary failure:  Das angegebene Modul wurde nicht gefunden.

Fehler: Laden fehlgeschlagen
Ausführung angehalten
ERROR: loading failed
* removing 'C:/Users/jawach/Documents/R/win-library/3.4/rPython'
Error: Command failed (1)

Sorry for the german: " LoadLibrary failure: ImportError: No module named site ERROR: loading failed"

R 32-bit results in another error:

* installing *source* package 'rPython' ...
** libs
Warnung: this package has a non-empty 'configure.win' file,
so building only the main architecture

make: Nothing to be done for `all'.
installing to C:/Users/jawach/Documents/R/win-library/3.4/rPython/libs/i386
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for 'rPython':
 .onLoad failed in loadNamespace() for 'rPython', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error: kann shared object 'C:/Users/jawach/Documents/R/win-library/3.4/rPython/libs/i386/rPython.dll' nicht laden:
  LoadLibrary failure:  %1 ist keine zulässige Win32-Anwendung.

Fehler: Laden fehlgeschlagen
Ausführung angehalten
ERROR: loading failed
* removing 'C:/Users/jawach/Documents/R/win-library/3.4/rPython'
Error: Command failed (1)

Sorry for the german: "LoadLibrary failure: %1 is not a valid Win32 application."

So maybe I can get it work with the very same specs like you?

Fideldue avatar Oct 19 '17 15:10 Fideldue

I am using Windows 10 64-bit. My R version is: R version 3.4.2. It works with Anaconda as well (I am using Anaconda2 & Python27). Did you configure your configure.win file correctly? My config was:

#!/bin/sh

echo 'PKG_LIBS=-L"D:/Anaconda/libs" -lpython27'  > src/makevars.win
echo 'PKG_CFLAGS=-I"D:/Anaconda/include"'     >> src/makevars.win

Try to do the same and let me know if it works for you. Do not forget to restart your R sesion after the changes.

JessQuevza avatar Oct 19 '17 15:10 JessQuevza

Thanks for your tips. All my configuration seemed to be alright, but I was able to get it working with just re-installing Rtools (bcs these tools were your major problem as well) with all toolchains and everything and the focus on the toolchains pointing to the right R installation. So yes it works finally! :)

My configuration: Windows 10 64-bit, R version 3.4.2 64-bit, Anaconda3 with Python 3.6 64-bit system enviroment variable PYTHONHOME (leading to ...anaconda3)
system enviroment variable PYTHONPATH (leading to ..anaconda3\libs) added C:\Rtools to Path system enviroment variable

Fideldue avatar Oct 20 '17 09:10 Fideldue

Hi,Fideldue. Do you have a lpython36 file in ...anaconda3 folder?

forsenshi avatar Mar 01 '18 20:03 forsenshi

Another working example here with Anaconda and Python 3.6.6: configure.win has the following:

#!/bin/sh

echo 'PKG_LIBS=-LC:/ProgramData/Anaconda3/libs -lpython36'  > src/makevars.win
echo 'PKG_CFLAGS=-I"C:/ProgramData/Anaconda3/include"'     >> src/makevars.win

C:\Rtools\mingw_64\bin is added to PATH. sessionInfo() is

R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Hope this serves as a shortcut for somebody.

sysilviakim avatar Mar 11 '19 04:03 sysilviakim