5

I am trying to use the R package mRMRe for feature selection within Python as except this feature selection part, all the other modules are in Python.

utils = importr('utils')  # -- Only once.
utils.install_packages('mRMRe')
# Now we begin by loading in the R packages
pymrmr = importr('mRMRe')

When the install_packages part is run I get:

In[20]: utils.install_packages('mRMRe')
   ...: 
Out[20]: rpy2.rinterface.NULL

I think the installation is not happening properly because :

In[19]: pymrmr = importr('mRMRe')
   ...: 
Traceback (most recent call last):
  File "C:\hduser\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2910, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-19-e65c804fa4f7>", line 1, in <module>
    pymrmr = importr('mRMRe')
  File "C:\hduser\AppData\Local\Continuum\anaconda3\lib\site-packages\rpy2\robjects\packages.py", line 453, in importr
    env = _get_namespace(rname)
rpy2.rinterface.RRuntimeError: Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  **unable to load shared object 'C:/Program Files/R/R-3.4.3/library/stats/libs/x64/stats.dll':
  LoadLibrary failure:  The specified module could not be found.**

I am not sure how to resolve this. Can someone please help me!

Hello, Based on the question above , I could successfully install and use mRMRe functions from within Python. One of the tweaks was to call some functions mRMR.classic in R as mRMR_classic in Python. However, the next step of changing the data format presents a further challenge of memory error for even a small size of 266MB. Please see the below image for illustation:

enter image description here I am not sure how this is to be resolved. Can someone please help me in this?

Shuvayan Das
  • 1,198
  • 3
  • 20
  • 40
  • Try not installing R packages in Python. Install them first in R. Then, import them in Python. This may help in using appropriate library paths. – Parfait Apr 08 '18 at 12:47
  • Have look there: https://stackoverflow.com/questions/10917532/memory-allocation-error-cannot-allocate-vector-of-size-75-1-mb – Jacques Gaudin Apr 17 '18 at 19:02

0 Answers0