【发布时间】:2016-08-17 19:58:50
【问题描述】:
我有一个使用pyenv-virtualenv 设置的 Python virtualenv。我安装了R statistical software,现在我需要安装rpy2 包以允许Python和R之间的通信。
Python v2.7.12 和 R 版本 3.3.1 (2016-06-21) 均已安装。
尝试使用pip install rpy2 安装rpy2 失败:
/usr/bin/ld: no se puede encontrar -llzma
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/home/gabriel/.pyenv/versions/2.7.12/envs/test-env/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b7O2v3/rpy2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-4SXyxe-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/gabriel/.pyenv/versions/2.7.12/envs/asteca-env/include/site/python2.7/rpy2" failed with error code 1 in /tmp/pip-build-b7O2v3/rpy2/
no se puede encontrar -llzma 表示can't find -llzma。
python-dev 已安装在我的系统中。
如何绕过这个问题?
【问题讨论】:
-
rpy2 应该在 virtualenv 中工作。安装时打印到终端的早期消息可能包含有用的信息,如果您能够共享它们。
-
很抱歉花了这么长时间来回答@lgautier,直到现在我都无法访问安装virtualenv的系统。问题是我在创建 virtualenv 之后 安装了
python-dev。我现在将添加一个详细说明此问题的答案。