解决只读系统拒绝的权限

时间:2019-12-29 17:23:51

标签: bash chmod permission-denied kaggle

在Kaggle中使用python时,我正在尝试在os.system(command)函数中执行程序。该代码可直接在linux / unix命令行上运行,但不能在Kaggle中运行。简而言之,我遇到的错误是“只读文件系统”,后跟“ sh:权限被拒绝”。有谁知道如何解决这一问题?谢谢。

#!/bin/bash
import os, sys, stat
import os.path

os.chdir("/kaggle/input/llrdata")

TheCommand = 'chmod u+x ll64'
os.system(TheCommand)
TheCommand2 = './ll64 /kaggle/input/llrdata2/input.txt -d  -oThreadsPerTest=4'
os.system(TheCommand2)

输出:

[NbConvertApp] Converting notebook __notebook__.ipynb to notebook
4.57
1
[NbConvertApp] Executing notebook with kernel: python3
4.62
2
chmod: changing permissions of 'll64': Read-only file system
4.62
3
sh: 1: ./ll64: Permission denied
5.08
4
[NbConvertApp] Writing 1404 bytes to __notebook__.ipynb
5.98
5
[NbConvertApp] Converting notebook __notebook__.ipynb to html
6.55
6
[NbConvertApp] Writing 273343 bytes to __results__.html

https://askubuntu.com/questions/1199238/executing-program-from-kaggle

0 个答案:

没有答案