2

我通过 Anaconda 2 和最新版本的 R 安装了 python 2.7.13。

我按照说明https://github.com/cjgb/rPython-win运行了以下代码:

    library(devtools)
    install("C:/Users/Yang Huang/Desktop/rPython")

并出现以下消息。

 library(devtools)
    > install("C:/Users/rPython")
    Installing rPython
    "C:/PROGRA~1/R/R-33~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL "C:/Users/rPython"  \
      --library="C:/Users/Yang Huang/Documents/R/win-library/3.3" --install-tests 

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

    c:/Rtools/mingw_64/bin/gcc -shared -s -static-libgcc -o rPython.dll tmp.def pycall.o -LC:/Anaconda2/libs -lpython27 -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-33~1.3/bin/x64 -lR
    C:/Rtools/mingw_64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Anaconda2/libs/python27.lib when searching for -lpython27
    C:/Rtools/mingw_64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Anaconda2/libs/python27.lib when searching for -lpython27
    C:/Rtools/mingw_64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Anaconda2/libs\python27.lib when searching for -lpython27
    C:/Rtools/mingw_64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lpython27
    collect2.exe: error: ld returned 1 exit status
    no DLL was created
    ERROR: compilation failed for package 'rPython'
    * removing 'C:/Users/Yang Huang/Documents/R/win-library/3.3/rPython'
    Error: Command failed (1)

configure.win的是

#!/bin/sh

echo 'PKG_LIBS=-LC:/Anaconda2/libs -lpython27'  > src/makevars.win
echo 'PKG_CFLAGS=-I"C:/Anaconda2/include"'     >> src/makevars.win

感谢您调查此问题。

4

0 回答 0