I installed python 2.7.8 along with 2.7.5, which comes with OSX 10.9.4.
Now, how can I point rPython to python 2.7.8?
Attempt # 1
I modified OSX .bash_profile as follows to point everything to a new python installation.
export PATH=/usr/local/Cellar/python/2.7.8/bin/:$PATH:usr/local/bin:
And now, when I run python from the terminal, it correctly launches a newer version
mba:~ tommy$ which python /usr/local/Cellar/python/2.7.8/bin//python
However, rPython still sees 2.7.5.
> library(rPython) Loading required package: RJSONIO > python.exec("import sys; print(sys.version)") 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]
Attempt # 2
It seems that .bash_profile not used by R at all ... so I tried changing PATH inside R. But still no luck.
> Sys.getenv("PATH") [1] "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" > Sys.setenv(PATH = "usr/local/Cellar/python/2.7.8/bin") > library(rPython) Loading required package: RJSONIO > python.exec("import sys; print(sys.version)") 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]
Attempt # 3
I tried uninstalling and reinstalling the rPython package, thinking that it was using the version of Python that was detected during installation. Bad luck.
Attempt # 4
I tried to install from the source to make sure that this is something ... no luck.
Update
So, it seems that the problem is not related to rPython itself.
http://cran.r-project.org/web/packages/rPython/INSTALL
The rPython package is dependent on Python (> = 2.7).
It requires both Python and its headers and libraries. These can be found in the python and python-dev packages in a Debian-like Linux distribution.
On systems where multiple versions of Python coexist, the user can select the version of Python to use during installation. By default, the package will be installed using the Python version specified
$ python --version
When I run this in the terminal ..
mba:src tommy$ python --version Python 2.7.8
But when I launched it in R ...
> system("python --version") Python 2.7.5
So the problem is that R does not use OSX .bash_profile . I need to figure out how to change PATH outside of .bash_profile or get R to use .bash_profile .
What else can I try to get rPython while working with 2.7.8 ?