我知道有几个问题涉及这个问题,但我很难弄清楚,如果我的问题有一个解决方案。我正在使用 Mac 10.6.8、MacPorts 2.1.3。
在这里,我指的是关于 SO 的一个讨论,我的问题似乎得到了解决。这就是我所做的:
$ sudo port install py-rpy2 # seemed to be fine. A
$ python -m 'rpy2.tests' # gave the output
usr/bin/python: No module named rpy2
$ /opt/local/bin/python2.7 -m 'rpy2.tests # results in a
'Segmentation fault' # and MacOS is complaining..
升级所有过时的软件包后
$ sudo port -f uninstall py-rpy2
$ sudo port -f install py-rpy2
... the same as above.<br>
$ sudo easy_install rpy2
抛出许多错误并以
'error: Setup script exited with error: command 'gcc-4.2' failed with exit status 1'
你可以在这里找到完整的输出。
我只有一个
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/
路径,2.7没有
/Library/Frameworks/Python.framework/Versions/
入口。
localhost:~$ ls /opt/local/bin/python*
/opt/local/bin/python2.4
/opt/local/bin/python3.3 /opt/local/bin/python2.6
/opt/local/bin/python3.3-config /opt/local/bin/python2.6-config
/opt/local/bin/pythonw2.6 /opt/local/bin/python2.7
/opt/local/bin/pythonw2.7 /opt/local/bin/python2.7-config
/opt/local/bin/pythonw3.3
$ which python
'/usr/bin/python'
这是 Python 2.6.1。