运行命令pip install rpy2
将导致以下输出和错误消息:
Collecting rpy2
Using cached rpy2-3.5.12.tar.gz (217 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [28 lines of output]
Traceback (most recent call last):
File "c:\users\97254\working_project\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "c:\users\97254\working_project\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "c:\users\97254\working_project\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\97254\AppData\Local\Temp\pip-build-env-b21o8iu5\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "C:\Users\97254\AppData\Local\Temp\pip-build-env-b21o8iu5\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
self.run_setup()
File "C:\Users\97254\AppData\Local\Temp\pip-build-env-b21o8iu5\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 124, in <module>
File "<string>", line 110, in get_r_c_extension_status
File "./rpy2/situation.py", line 295, in get_r_flags
_get_r_cmd_config(r_home, flags,
File "./rpy2/situation.py", line 255, in _get_r_cmd_config
output = subprocess.check_output(
File "C:\Users\97254\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\97254\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 501, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\97254\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 947, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\97254\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1416, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
我根据另一个Stackoverflow帖子上的说明卸载并重新安装了R和相关目录,并得到了同样的错误。我还尝试安装了以前版本的rpy2,得到了同样的错误。
如果有人知道如何解决这个错误,我很乐意得到它。
谢谢
2条答案
按热度按时间izkcnapc1#
尝试
或者从github repo而不是PIP安装rpy2
bbuxkriu2#
最后,我从rpy2's GitHub page下载了一个rpy 2的zip文件,解压缩并将其放在python项目的site-packages中,这样就可以使用该包了。