【问题标题】:Error in google colab /bin/sh: Permission deniedgoogle colab /bin/sh 中的错误:权限被拒绝
【发布时间】:2022-02-01 02:18:09
【问题描述】:

我从 github 下载了this code,它在我的本地计算机上运行良好,但我需要在 google colab 中使用,它会抛出错误。更准确地说,我得到的错误输出是:

/bin/sh: 1: ./rbox: Permission denied
/bin/sh: 1: ./qhull: Permission denied
...
ModuleNotFoundError: No module named 'python_tools.fastmodules'

完整的错误消息可以在here 以及笔记本here 中看到。我尝试了不同的建议来授予执行文件 ./rbox./qhull 的权限 - 我在包含的代码 sn-p 之前插入了一个新单元格

!chmod 755 -R /content/gdrive/MyDrive/PhD/revolver/qhull/src/ #pointing to the file-directory

!chmod 755 ./rbox

!chmod +x /content/gdrive/MyDrive/PhD/revolver/qhull/src/rbox

但它们都没有解决错误。如何解决错误消息?如果有人可以将 github 代码从链接下载到 google drive 中确认他可以无错误地运行它,那也很棒。 github页面上提供了安装说明,您可以使用我的params.py 文件并在其中设置tracer_file 指向我使用的file,或任何具有3 列的虚拟csv 文件。天呐!您的贡献将帮助我为我的博士学位运行天体物理学模拟

【问题讨论】:

  • 嗯.. 如果运行 ./rbox./qhull manually 会发生什么?看起来主要问题是您无法执行这些二进制文件。可能这里是 colab 中的一些访问权限限制?

标签: python jupyter-notebook sh google-colaboratory executable


【解决方案1】:

我搞错了文件的位置。 rboxqhull 文件在不同文件夹中有不同的副本,所以我应该这样做

!chmod +x /content/gdrive/MyDrive/PhD/revolver/qhull/rbox
!chmod +x /content/gdrive/MyDrive/PhD/revolver/qhull/qhull

而不是

!chmod +x /content/gdrive/MyDrive/PhD/revolver/qhull/src/rbox
!chmod +x /content/gdrive/MyDrive/PhD/revolver/qhull/src/qhull

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-04-09
    • 1970-01-01
    • 2021-10-19
    • 1970-01-01
    • 2013-05-27
    • 1970-01-01
    • 2011-07-28
    相关资源
    最近更新 更多