簡體   English   中英

PermissionError: [Errno 13] 權限被拒絕和子進程錯誤

[英]PermissionError: [Errno 13] Permission denied and Subprocess error

    PermissionError                           Traceback (most recent call last)
<ipython-input-8-bab992cc7bb5> in <module>()
     67 
     68 if __name__ == "__main__":
---> 69     main()

/content/gdrive/My Drive/LORE/pyyadt.py in fit(df, class_name, columns, features_type, discrete, continuous, filename, path, sep, log)
     32     cmd = 'yadt/dTcmd -fd %s -fm %s -sep %s -d %s' % (
     33         data_filename, names_filename, sep, tree_filename)
---> 34     output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
     35     # cmd = r"dTcmd -fd %s -fm %s -sep '%s' -d %s" % (
     36     #     data_filename, names_filename, sep, tree_filename)

/usr/lib/python3.6/subprocess.py in check_output(timeout, *popenargs, **kwargs)
    354 
    355     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
--> 356                **kwargs).stdout
    357 
    358 

/usr/lib/python3.6/subprocess.py in run(input, timeout, check, *popenargs, **kwargs)
    421         kwargs['stdin'] = PIPE
    422 
--> 423     with Popen(*popenargs, **kwargs) as process:
    424         try:
    425             stdout, stderr = process.communicate(input, timeout=timeout)

/usr/lib/python3.6/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
    727                                 c2pread, c2pwrite,
    728                                 errread, errwrite,
--> 729                                 restore_signals, start_new_session)
    730         except:
    731             # Cleanup if the child failed starting.

/usr/lib/python3.6/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
   1362                         if errno_num == errno.ENOENT:
   1363                             err_msg += ': ' + repr(err_filename)
-> 1364                     raise child_exception_type(errno_num, err_msg, err_filename)
   1365                 raise child_exception_type(err_msg)
   1366 

PermissionError: [Errno 13] Permission denied: 'yadt/dTcmd'

我無法訪問該文件,因此腳本沒有運行。 在虛擬環境中也嘗試了不同的 python 版本。 對此子流程錯誤有任何幫助嗎?

文件“dTcmd”沒有擴展名。

看起來您正在嘗試執行名為yadt/dTcmd的文件,但它沒有標記為可執行文件。 添加執行權限(適用於所有用戶),如下所示:

chmod a+x yadt/dTcmd

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM