我需要在运行python 2.6(旧版CentOS版本)的机器上从源代码安装软件包rpy2
。 rpy2的当前版本是2.5,它仅在python> = 2.7上兼容。
从official documentation开始,我查看了最后几个版本,发现2.2
是最后一个在Python 2.6上运行的版本。太糟糕了,它不会安装:
# python26 setup.py build install
running build
running build_py
running build_ext
Traceback (most recent call last):
File "setup.py", line 441, in <module>
[os.path.join('doc', 'source', 'rpy2_logo.png')])],
File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/usr/lib64/python2.6/distutils/command/build.py", line 134, in run
self.run_command(cmd_name)
File "/usr/lib64/python2.6/distutils/cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python2.6/distutils/dist.py", line 994, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib64/python2.6/distutils/cmd.py", line 117, in ensure_finalized
self.finalize_options()
File "setup.py", line 152, in finalize_options
config += get_rconfig(r_home, about)
File "setup.py", line 312, in get_rconfig
rc = RConfig.from_string(rconfig, allow_empty = allow_empty)
File "setup.py", line 272, in from_string
+ '\nin string\n' + string)
ValueError: Invalid substring
-fopenmp
in string
-Wl,--export-dynamic -fopenmp -L/usr/lib64/R/lib -lR -lrt -ldl -lm
解:
我需要安装以前版本的R(2.12或2.13),如the docs
中所述