我的[R版本3.4.1是,Python版本3.5.2是,和操作系统是Ubuntu的16.04.2使用rPython进口numply与Python 3.5
我已经设置RPYTHON_PYTHON_VERSION = 3.5安装rPython,当这是我的默认Python版本的rPython。
♥ python.exec('import sys')
♥ python.exec('print(sys.version)')
3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609]
当我通过rPython导入numpy的(有使用Python 3.5使用进口numpy的没有问题,一切正常),我得到这个:
♥ python.exec('import numpy')
Error in python.exec("import numpy") :
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: /usr/local/lib/python3.5/dist-packages/numpy/core/multiarray.cpython-35m-x86_64-linux-gnu.so: undefined symbol: PyType_GenericNew
但是,如果我设置RPYTHON_PYTHON_VERSION = 2并重新安装rPython,导入numpy的作品。我怎样才能成功导入numpy下的python 3.5 rPython?
谢谢Bartimus,我试过网状(它是由Rstudio家伙开发的,网状蟒蛇是世界上最长的蛇),它可以用python 3.5导入numpy。并回答你的问题,是的,我可以导入一些其他的软件包,例如pymongo,datetime和bson,除了python 3.5下的rPython下的numpy。我唯一关心的是将python3集成到R中,所以你真的帮助我,再次感谢。 –