numpy - Using rPython import numply with python 3.5 -


my r version 3.4.1, python version 3.5.2 , , os ubuntu 16.04.2

i have set rpython_python_version=3.5 when installing rpython, default python version 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] 

when import numpy through rpython (there no issue using import numpy in python 3.5, works fine.), got this:

♥ python.exec('import numpy') error in python.exec("import numpy") : importing multiarray numpy extension module failed.  trying import failed build of numpy. if you're working numpy git repo, try `git clean -xdf` (removes 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 

however, if set rpython_python_version=2 , reinstall rpython, import numpy works. how can import numpy under rpython python 3.5?

first off, can import packages python 3.5.3 r/rpython?

i having problem. error same posters (numpy won't load). later found cannot import packages. can import packages in python 2.7.13 , python 3.5.3 (just not through r/rpython). leads me believe 'rpython' r package error. here things have tried fix this:

1) have tried installing/reinstalling r package rpython use either python 2.7.13 or python 3.5.3. connect r python 2.7.13 via reinstall of rpython package:

install.packages("rpython",lib= "home/myusername/r/x86_64-pc-linux-gnu-library/3.4", configure.vars= "rpython_python_version=2") 

using "rpython_python_version=3" during install allowed me connect r python 3.5.3. call "import numpy" r when rpython connected python 2.7.13, not when connected 3.5.3.

2) have tracked down numpy , scipy's had been installed , uninstalled them. had several copies of each both python 2.7.13 , python 3.5.3. reinstalling using pip , pip3 did not fix problem (i restarted r beforehand safe).

from both accounts seems problem r package 'rpython'. try newer 'reticulate' package r, , see if works better you. however, have not been able parallel threads work when using reticulate connect r python, , unfortunately need do. threading did work when using 'rpython', package need requires python 3+. keep troubleshooting , update post if able solve it. in meantime, give 'reticulate' shot, neat package.

edit able load numpy python 3.5.3 in r using 'reticulate' package.

edit2 find post in future, solution find use python3 code multithreading r call python files system(python3 "path_to_python_script" arg1 arg2 arg3)


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -