无法在MAC中通过pip安装rpy2

2024-09-30 08:36:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我无法在MAC OS中通过pip或PyCharm安装rpy2(Python软件包)。
但我可以成功地运行Python(通过PyCharm)和R(通过RStudio)…
主要错误消息是

"Error: Tried to guess R's HOME but no command (R) in the PATH." and "Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-OtKzsd/rpy2/".

我想这个问题可能与R环境路径设置有关?
但我还是不知道如何解决这个问题….
完整的错误消息如下:

host-217:~ ChenGuanYing$ sudo pip install rpy2
The directory '/Users/ChenGuanYing/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/ChenGuanYing/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting rpy2
  Downloading rpy2-2.7.8.tar.gz (178kB)
    100% |████████████████████████████████| 184kB 1.1MB/s 
    Complete output from command python setup.py egg_info:
    Error: Tried to guess R's HOME but no command (R) in the PATH.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-OtKzsd/rpy2/

enter image description here


Tags: pipandtheinpyinfoeggwith

热门问题