【问题标题】:I can't make PypeR run anymore我不能再让 PypeR 运行了
【发布时间】:2016-02-10 18:00:24
【问题描述】:

我不能再运行美妙的PypeR(r 到 python 接口)了。 我可以导入它,但是当我尝试运行它时它崩溃了。

我怀疑是因为我安装了 El Capitan OSX。

我尝试安装更新pypeR,但没有成功。

当我运行它时:

例如

r = R()

这是我得到的错误。

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    a = R()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyper.py", line 600, in __init__
    self.__dict__['prog'] = Popen(RCMD, stdin=PIPE, stdout=PIPE, stderr=return_err and _STDOUT or childstderr, startupinfo=info)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

有人知道如何解决这个问题吗?


更新:

如果我从 shell 而不是 Idle 运行它,它可以工作。 我真的不明白为什么。

Python 的版本完全一样,同时构建。

【问题讨论】:

    标签: python r pyper


    【解决方案1】:

    看起来PypeR 找不到要运行的R。当您使用空闲时,R 命令很可能不在command ($PATH) 的搜索路径中。一种方法是明确指出要使用哪个R 命令,例如,如果R 命令位于/usr/local/bin,您可以使用

    r = R(RCMD="/usr/local/bin/R")
    

    当然最好能加上R的空闲环境路径。

    【讨论】:

    • 嘿@Xiao-Qin 我在一台 pyper 甚至不从 shell 运行的计算机上,但前提是我指定了你上面写的路径。有什么办法可以改变系统路径,让它自动找到?您指的是什么命令($PATH)?我尝试通过将路径添加到 R 来修改 sys.path,但它不起作用:/提前致谢!
    猜你喜欢
    • 2021-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-29
    • 1970-01-01
    • 1970-01-01
    • 2020-08-04
    • 1970-01-01
    相关资源
    最近更新 更多