- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我尝试使用以下命令在我的计算机上使用 R 3.1.1 安装 rpy2:
pip install rpy2 --user
它输出成功,但是当我尝试使用
测试它时python -m rpy2.tests
它给我以下错误
File "/mnt/work1/software/python/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/mnt/work1/software/python/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/mnt/work1/users/home2/stamaki/.local/lib/python2.7/site-packages/rpy2-2.6.0-py2.7-linux-x86_64.egg/rpy2/tests.py", line 23, in <module>
import rpy2.tests_rpy_classic
File "/mnt/work1/users/home2/stamaki/.local/lib/python2.7/site-packages/rpy2-2.6.0-py2.7-linux-x86_64.egg/rpy2/tests_rpy_classic.py", line 3, in <module>
import rpy2.rpy_classic as rpy
File "/mnt/work1/users/home2/stamaki/.local/lib/python2.7/site-packages/rpy2-2.6.0-py2.7-linux-x86_64.egg/rpy2/rpy_classic.py", line 5, in <module>
import rpy2.rinterface as ri
File "/mnt/work1/users/home2/stamaki/.local/lib/python2.7/site-packages/rpy2-2.6.0-py2.7-linux-x86_64.egg/rpy2/rinterface/__init__.py", line 100, in <module>
from rpy2.rinterface._rinterface import *
ImportError: /mnt/work1/users/home2/stamaki/.local/lib/python2.7/site-packages/rpy2-2.6.0-py2.7-linux-x86_64.egg/rpy2/rinterface/_rinterface.so: undefined symbol: R_ClassSymbol
这似乎是环境变量中未设置 R 的 C 包含路径导致 sexp.c
的编译不包含 Rinternals.h
来自 R 文件夹,其中定义了 R_ClassSymbol
但是在 ~/.bashrc
中我确实设置了以下内容: 导出 C_INCLUDE_PATH="/mnt/work1/software/R/3.1.1/lib64/R/include:${C_INCLUDE_PATH}" 导出 LD_LIBRARY_PATH="/mnt/work1/software/R/3.1.1/lib64/R/lib:${LD_LIBRARY_PATH}"
所以我觉得这个错误不应该发生。知道为什么会这样吗?
完整安装日志:
Downloading/unpacking rpy2
Running setup.py (path:/tmp/pip_build_stamaki/rpy2/setup.py) egg_info for package rpy2
R was not built as a library
R was not built as a library
/tmp/pip_build_stamaki/rpy2/setup.py:211: UserWarning: No include specified
warnings.warn('No include specified')
/tmp/pip_build_stamaki/rpy2/setup.py:222: UserWarning: No libraries as -l arguments to the compiler.
warnings.warn('No libraries as -l arguments to the compiler.')
R version 3.1.1 (2014-07-10) -- "Sock it to Me"
/mnt/work1/software/R/3.1.1/lib64/R/bin/R CMD config --ldflags
/mnt/work1/software/R/3.1.1/lib64/R/bin/R CMD config --cppflags
Compilation parameters for rpy2's C components:
include_dirs = []
library_dirs = []
libraries = []
extra_link_args = []
R version 3.1.1 (2014-07-10) -- "Sock it to Me"
warning: no files found matching 'README' anywhere in distribution
warning: no previously-included files matching '*patch*' found anywhere in distribution
warning: no previously-included files matching '*diff*' found anywhere in distribution
warning: no previously-included files matching '.hg' found anywhere in distribution
warning: no files found matching 'MANIFEST'
warning: no files found matching 'README'
warning: no files found matching 'MPL_LICENSE'
warning: no files found matching 'GPL_LICENSE'
warning: no files found matching 'LGPL_LICENSE'
no previously-included directories found matching 'dist'
warning: no files found matching 'doc/source/rpy2_logo.png'
Requirement already satisfied (use --upgrade to upgrade): six in /mnt/work1/software/python/2.7/lib/python2.7/site-packages (from rpy2)
Requirement already satisfied (use --upgrade to upgrade): singledispatch in /mnt/work1/users/home2/stamaki/.local/lib/python2.7/site-packages/singledispatch-3.4.0.3-py2.7.egg (from rpy2)
Installing collected packages: rpy2
Running setup.py install for rpy2
R was not built as a library
R was not built as a library
/tmp/pip_build_stamaki/rpy2/setup.py:211: UserWarning: No include specified
warnings.warn('No include specified')
/tmp/pip_build_stamaki/rpy2/setup.py:222: UserWarning: No libraries as -l arguments to the compiler.
warnings.warn('No libraries as -l arguments to the compiler.')
R version 3.1.1 (2014-07-10) -- "Sock it to Me"
/mnt/work1/software/R/3.1.1/lib64/R/bin/R CMD config --ldflags
/mnt/work1/software/R/3.1.1/lib64/R/bin/R CMD config --cppflags
Compilation parameters for rpy2's C components:
include_dirs = []
library_dirs = []
libraries = []
extra_link_args = []
R version 3.1.1 (2014-07-10) -- "Sock it to Me"
building 'rpy2.rinterface._rinterface' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/mnt/work1/software/python/2.7/include/python2.7 -I/mnt/work1/software/python/2.7/include/ -fPIC -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_SIGJMP=1 -DRIF_HAS_RSIGHAND=1 -DCSTACK_DEFNS=1 -DHAS_READLINE=1 -I./rpy/rinterface -I/mnt/work1/software/python/2.7/include/python2.7 -c ./rpy/rinterface/_rinterface.c -o build/temp.linux-x86_64-2.7/./rpy/rinterface/_rinterface.o
In file included from /mnt/work1/software/python/2.7/include/python2.7/Python.h:8,
from ./rpy/rinterface/_rinterface.c:55:
/mnt/work1/software/python/2.7/include/python2.7/pyconfig.h:1161:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/signal.h:29,
from ./rpy/rinterface/_rinterface.c:51:
/usr/include/features.h:213:1: warning: this is the location of the previous definition
In file included from ./rpy/rinterface/_rinterface.c:122:
./rpy/rinterface/embeddedr.c: In function ‘SexpObject_clear’:
./rpy/rinterface/embeddedr.c:48: warning: unused variable ‘res’
In file included from ./rpy/rinterface/_rinterface.c:125:
./rpy/rinterface/sexp.c: In function ‘Sexp_init’:
./rpy/rinterface/sexp.c:738: warning: unused variable ‘copy’
./rpy/rinterface/_rinterface.c: At top level:
./rpy/rinterface/sequence.c:2174: warning: ‘ComplexVectorSexp_AsSexp’ defined but not used
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ShowFiles’:
./rpy/rinterface/_rinterface.c:874: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ResetConsole’:
./rpy/rinterface/_rinterface.c:720: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_FlushConsole’:
./rpy/rinterface/_rinterface.c:686: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ChooseFile’:
./rpy/rinterface/_rinterface.c:770: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ReadConsole’:
./rpy/rinterface/_rinterface.c:541: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_WriteConsoleEx’:
./rpy/rinterface/_rinterface.c:382: warning: ‘consolecallback’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c:397: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ShowMessage’:
./rpy/rinterface/_rinterface.c:472: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_CleanUp’:
./rpy/rinterface/_rinterface.c:1022: warning: ‘gstate’ may be used uninitialized in this function
gcc -pthread -shared -L/mnt/work1/software/python/2.7/lib/ -I/mnt/work1/software/python/2.7/include/python2.7 -I/mnt/work1/software/python/2.7/include/ build/temp.linux-x86_64-2.7/./rpy/rinterface/_rinterface.o -o build/lib.linux-x86_64-2.7/rpy2/rinterface/_rinterface.so
building 'rpy2.rinterface._rpy_device' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/mnt/work1/software/python/2.7/include/python2.7 -I/mnt/work1/software/python/2.7/include/ -fPIC -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_SIGJMP=1 -DRIF_HAS_RSIGHAND=1 -DCSTACK_DEFNS=1 -DHAS_READLINE=1 -Irpy/rinterface -I/mnt/work1/software/python/2.7/include/python2.7 -c ./rpy/rinterface/_rpy_device.c -o build/temp.linux-x86_64-2.7/./rpy/rinterface/_rpy_device.o
./rpy/rinterface/_rpy_device.c:935: warning: ‘GrDev_clear’ defined but not used
gcc -pthread -shared -L/mnt/work1/software/python/2.7/lib/ -I/mnt/work1/software/python/2.7/include/python2.7 -I/mnt/work1/software/python/2.7/include/ build/temp.linux-x86_64-2.7/./rpy/rinterface/_rpy_device.o -o build/lib.linux-x86_64-2.7/rpy2/rinterface/_rpy_device.so
warning: no files found matching 'README' anywhere in distribution
warning: no previously-included files matching '*patch*' found anywhere in distribution
warning: no previously-included files matching '*diff*' found anywhere in distribution
warning: no previously-included files matching '.hg' found anywhere in distribution
warning: no files found matching 'MANIFEST'
warning: no files found matching 'README'
warning: no files found matching 'MPL_LICENSE'
warning: no files found matching 'GPL_LICENSE'
warning: no files found matching 'LGPL_LICENSE'
no previously-included directories found matching 'dist'
warning: no files found matching 'doc/source/rpy2_logo.png'
Successfully installed rpy2
Cleaning up...
此外,无论如何请不要推荐我需要 sudo,例如重新安装 R,因为有时会被其他人推荐。我没有系统的管理权限。
最佳答案
在日志的顶部附近,您会看到:R 不是作为库构建的。
R 必须 被编译为共享库以便 rpy2 工作。
关于python - 无法正确安装 rpy2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30968865/
我通过 spring ioc 编写了一些 Rest 应用程序。但我无法解决这个问题。这是我的异常(exception): org.springframework.beans.factory.BeanC
我对 TestNG、Spring 框架等完全陌生,我正在尝试使用注释 @Value通过 @Configuration 访问配置文件注释。 我在这里想要实现的目标是让控制台从配置文件中写出“hi”,通过
为此工作了几个小时。我完全被难住了。 这是 CS113 的实验室。 如果用户在程序(二进制计算器)结束时选择继续,我们需要使用 goto 语句来到达程序的顶部。 但是,我们还需要释放所有分配的内存。
我正在尝试使用 ffmpeg 库构建一个小的 C 程序。但是我什至无法使用 avformat_open_input() 打开音频文件设置检查错误代码的函数后,我得到以下输出: Error code:
使用 Spring Initializer 创建一个简单的 Spring boot。我只在可用选项下选择 DevTools。 创建项目后,无需对其进行任何更改,即可正常运行程序。 现在,当我尝试在项目
所以我只是在 Mac OS X 中通过 brew 安装了 qt。但是它无法链接它。当我尝试运行 brew link qt 或 brew link --overwrite qt 我得到以下信息: ton
我在提交和 pull 时遇到了问题:在提交的 IDE 中,我看到: warning not all local changes may be shown due to an error: unable
我跑 man gcc | grep "-L" 我明白了 Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more inf
我有一段代码,旨在接收任何 URL 并将其从网络上撕下来。到目前为止,它运行良好,直到有人给了它这个 URL: http://www.aspensurgical.com/static/images/a
在过去的 5 个小时里,我一直在尝试在我的服务器上设置 WireGuard,但在完成所有设置后,我无法 ping IP 或解析域。 下面是服务器配置 [Interface] Address = 10.
我正在尝试在 GitLab 中 fork 我的一个私有(private)项目,但是当我按下 fork 按钮时,我会收到以下信息: No available namespaces to fork the
我这里遇到了一些问题。我是 node.js 和 Rest API 的新手,但我正在尝试自学。我制作了 REST API,使用 MongoDB 与我的数据库进行通信,我使用 Postman 来测试我的路
下面的代码在控制台中给出以下消息: Uncaught DOMException: Failed to execute 'appendChild' on 'Node': The new child el
我正在尝试调用一个新端点来显示数据,我意识到在上一组有效的数据中,它在数据周围用一对额外的“[]”括号进行控制台,我认为这就是问题是,而新端点不会以我使用数据的方式产生它! 这是 NgFor 失败的原
我正在尝试将我的 Symfony2 应用程序部署到我的 Azure Web 应用程序,但遇到了一些麻烦。 推送到远程时,我在终端中收到以下消息 remote: Updating branch 'mas
Minikube已启动并正在运行,没有任何错误,但是我无法 curl IP。我在这里遵循:https://docs.traefik.io/user-guide/kubernetes/,似乎没有提到关闭
每当我尝试docker组成任何项目时,都会出现以下错误。 我尝试过有和没有sudo 我在这台机器上只有这个问题。我可以在Mac和Amazon WorkSpace上运行相同的容器。 (myslabs)
我正在尝试 pip install stanza 并收到此消息: ERROR: No matching distribution found for torch>=1.3.0 (from stanza
DNS 解析看起来不错,但我无法 ping 我的服务。可能是什么原因? 来自集群中的另一个 Pod: $ ping backend PING backend.default.svc.cluster.l
我正在使用Hibernate 4 + Spring MVC 4当我开始 Apache Tomcat Server 8我收到此错误: Error creating bean with name 'wel
我是一名优秀的程序员,十分优秀!