python - rpy2 import is not working -


When I try to import rpy2, I get an error. Here is the code and error

  & gt; & Gt; & Gt; Import Traceback (Most Recent Call Final): File "C: \ PF \ WinPython-64bit-3.3.3.3 \ python-3.3.3.amd64 \ lib \ site-packages \ IPython \ core \ interactiveshell.py", line 2828 In the file, "ipython-input-148-c258a0f70d44" gt; Row 1, & lt; modules & gt; Import pandas.rpy.common file in runcode ajl (code_obj, self.user_global_ns, self.user_ns) file " C: \ PF \ WinPython-64bit-3.3.3.3 \ python-3.3.3.amd64 \ lib \ site-packages \ pandas \ rpy \ common.py ", line 14, in & lt; modules & gt; Rpy2.robjects .packages Import Import Import Import: A module name 'rpy2'  

What could be the problem? I Python Version 3.3.3 and PANDAS Version 0.13.1

Edit

Tried to install rpy2 separately

  1. I get an error using python setup.py install which is not the module popen3 in OS .

  2. Running the site of Christophe Gohalke properly installing XE (rpy2-2.3.9.win32-py3.3.exe) directly. But if I try to do import pandas.rpy.common com then I get the following error (rpy2.rinterface._rinterface Import * to with DLL loading Problem) :

      traceback (most recent call final): File "C: \ PF \ WinPython-64bit-3.3.3.3 \ python-3.3.3.amd64 \ Lib \ site-packages \ IPython \ core \ interactiveshell.py ", edit run_code exec (code_obj, self.user_global_ns, self.user_ns) file" ipython-input-10-63ebebefea80 ">, line 1, In & lt; Module & gt; Import pandas.rpy. Com file as "C: \ PF \ WinPython-64bit-3.3.3.3 \ python-3.3.3.amd64 \ lib \ site-package \ pandas \ rpy \ common.py", line 14, & lt; Module & gt; Rpy2.robjects.packages Import import file from "C: \ PF \ WinPython-64bit-3.3.3.3 \ python-3.3.3.amd64 \ lib \ site-packages \ rpy2 \ robjects \ __ init__.py", line 15, In & lt; Module & gt; Rpy2.rinterface as a rinterface file as "c: \ pf \ winhen-64bit-3.3.3.3 \ python-3.3.3.amd64 \ lib \ site-packages \ rpy2 \ rinterface \ __ init__.py", line 103 , In & lt; Mod ule & gt; Rpy2.rinterface._rinterface * importError import: DLL failed:% 1 is not a valid Win32 application.  

edit

resolve it at the end. It seems that adding R_HOME and R_USER environment variables is a trick. RPy2 is a separate project from Panda, so you have to set it apart. You should be able to do pip installation rpy2 , then restart the python and try again.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -