简体   繁体   English

Termux:当 python 脚本运行 an.exe 时权限被拒绝

[英]Termux: permission denied when python script runs an .exe

I have a python script that relies on the execution of an.exe file.我有一个 python 脚本,它依赖于 an.exe 文件的执行。 It uses the subprocess module like this:它使用这样的子进程模块:

subprocess.run([
            "ffmpeg/ffmpeg.exe",
            url,
            path])

The python script works normally up until the above instruction is interpreted, then I get this exception: python 脚本正常工作,直到上述指令被解释,然后我得到这个异常:

PermissionError: [Errno 13] Permission denied: PosixPath('storage/emulated/legacy/scripts/ffmpeg/ffmpeg.exe')

The directories are ordered like this:目录的顺序如下:

"/scripts/pyscript.py "/scripts/pyscript.py

/scripts/ffmpeg/ffmpeg.exe" /scripts/ffmpeg/ffmpeg.exe"

I'm running Termux on an android device not rooted.我在没有植根的 android 设备上运行 Termux。 I have already tried changing file permissions with chmod but I get "Operation not permitted".我已经尝试使用 chmod 更改文件权限,但我得到“不允许操作”。

Do you have any workaround?你有什么解决方法吗?

You have two option:你有两个选择:

First you could change the permission of the file to Everyone or execute chmod 777 if your on linux.首先,如果您在 linux 上,您可以将文件的权限更改为Everyone或执行chmod 777

or或者

you could run the script as admin.您可以以管理员身份运行脚本。

For that you can use this as a reference.为此,您可以将此作为参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python.exe PermissionError: [Errno 13] Permission denied - Python .exe PermissionError: [Errno 13] Permission denied 编写文件时拒绝Python CGI脚本权限 - Python CGI script permission denied when writing file 通过 bash 启动 python 脚本时权限被拒绝 - Permission denied when launch python script via bash 从浏览器中的Python子进程调用Shell脚本时,权限被拒绝 - Permission Denied when Calling Shell Script from a Python Subprocess in Browser 错误:[Errno 13] 权限被拒绝:'./configure' 在 termux 上使用 pip3 install matplotlib - error: [Errno 13] Permission denied: './configure' when use pip3 install matplotlib on termux 尝试从另一个python脚本中运行python脚本时,出现“权限被拒绝”! - When attempting run a python script from within another python script, I get 'permission denied'! 使用python脚本的Unix at调度:权限被拒绝 - Unix `at` scheduling with python script: Permission denied 使用 Bash 的 Python 脚本的权限被拒绝? - Permission denied for Python script using Bash? 权限被拒绝在Mint 17.3上启动python脚本 - Permission Denied launching python script on Mint 17.3 尝试运行Shell脚本(包含Python子脚本)时权限被拒绝 - Permission Denied when trying to run Shell Script (containing Python sub-script)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM