symlink to anaconda python just yields standard Mac OS X python install

0 views
Skip to first unread message

davi...@gmail.com

unread,
May 8, 2015, 10:35:08 AM5/8/15
to anac...@continuum.io
Hi all

(For various reasons) I'm trying to use rPython (an R package linking R to Python) on Mac OS X 10.3, with an Anaconda installation of Python (Python 2.7.9) on top of the version of Python that comes with OS X (2.7.6).

Colleagues have had success by setting up symlinks to the Anaconda version of Python in /usr/bin, which seems to be where rPython looks for Python.

So I have done the following:

$ sudo ln -s /anaconda/bin/python2.7 /usr/bin/python2.7.9

$ sudo ln -s /anaconda/bin/python2.7-config /usr/bin/python2.7.9-config

But then we see this weird behaviour:

$ /usr/bin/python2.7.9

Python 2.7.6 (default, Sep  9 2014, 15:04:36)

$ /anaconda/bin/python2.7

Python 2.7.9 |Anaconda 2.0.0 (x86_64)| (default, Dec 15 2014, 10:37:34)

So /anaconda/bin/python2.7 does what you'd expect, and using "ls -l /usr/bin/pyth*" reveals that the symlink /usr/bin/python2.7.9 points to /anaconda/bin/python2.7. 

But /usr/bin/python2.7.9 does not give /anaconda/bin/python2.7 as (I think) it should.

My PATH variable looks like this:

$ echo $PATH

//anaconda/bin:/anaconda:/miniconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/texbin:/opt/local/bin:/opt/local/sbin:/Users/davismcc/Software/:/Users/davismcc/.emacs.d/:/Applications/IGV_2.0.14:/Users/davismcc/bin:/usr/local/ActivePerl-5.14/bin:/usr/local/ActivePerl-5.14/site/bin:/Applications/Emacs.app:/Users/davismcc/Software/plink-1.07-mac-intel:/Users/davismcc/Software/plinkseq/client:/Users/davismcc/Software/limix://anaconda/bin/scons

After trying a bunch of things (e.g hash -r), with think it's an issue with the PATH, but we're still just like ¯\_(ツ)_/¯

Any insights would be much appreciated. Otherwise, any other/better suggestions for getting rPython to work with Anaconda Python also very welcome (have tried setting RPYTHON_PYTHON_VARIABLE, but seems irrelevant if symlinks don't give us the version of Python that we want).


Thanks and best wishes

Davis



chris....@gmail.com

unread,
Jul 1, 2015, 9:08:28 AM7/1/15
to anac...@continuum.io, davi...@gmail.com
I am having a very similar problem; getting Rstudio to use anaconda instead of the stock Python that comes with OS X. Was any solution ever found?

liuqin...@gmail.com

unread,
Apr 18, 2016, 5:58:20 PM4/18/16
to Anaconda - Public, davi...@gmail.com

Hi, 

I use RStudio to execute rPython.
And set the anaconda python as work version instead of pre-installed python by following command in RStudio.

Sys.setenv(PATH = "/Users/UserName/anaconda3/bin")

Hope this would help.



在 2015年5月8日星期五 UTC-4上午10:35:08,davi...@gmail.com写道:

jon...@gmail.com

unread,
May 2, 2016, 11:14:52 AM5/2/16
to Anaconda - Public, davi...@gmail.com, liuqin...@gmail.com
This advice won't actually change the version of python that rPython points to. To be completely fair, installing rPython after running this command as written will not work at all due to it clobbering the path for the compiler for installing RJSONIO and rPython. Amending the command to include the original paths indicated in Sys.getenv('PATH') will avoid that problem, but it still won't point you at anaconda's python.

After installing rPython, running this does not change the version rPython was compiled against, which is what's called no matter what the path is.

I'm still searching for a solution to this issue, as are a few others. This isn't it, though.

-Jon
Reply all
Reply to author
Forward
0 new messages