ОШИБКА:root при запуске строки подпроцесса в python 3.8.5 на WSL

В настоящее время я запускаю сценарий для преобразования файла .edf в .asc, используя .exe (edf2asc.exe). В Windows я открываю cmd, перехожу в папку .exe, а затем в файл edf, который нужно преобразовать, например:

D: / {путь к .exe}edf2asc.exe path_to_edf.edf

и это сгенерирует файл .asc в той же папке .edf. На python я думал, что могу сделать то же самое, используя библиотеку подпроцесса (для эмуляции cmd) и созданный мной путь wsl, но вместо этого я получил код возврата: 1. Я сделал заказ, надеюсь, вы можете мне помочь, ребята, спасибо!

      import subprocess

edf2asc = '/home/edf2asc/edf2asc.exe'
edffile = '/home/edf2asc/file1.EDF'
subprocess.run(['/home/edf2asc/edf2asc.exe','/home/edf2asc/file1.EDF'], capture_output = True, check = True)
      ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.

ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.

ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3437, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-33-067124a5573a>", line 5, in <module>
    subprocess.run(['/home/diegonachon/eye-tracker/edf2asc/edf2asc.exe','/home/diegonachon/eye-tracker/edf2asc/Sujeto1_Control_AS_Todo.EDF'], capture_output = True, check = True)
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/diegonachon/eye-tracker/edf2asc/edf2asc.exe', '/home/diegonachon/eye-tracker/edf2asc/Sujeto1_Control_AS_Todo.EDF']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2061, in showtraceback
    stb = value._render_traceback_()
AttributeError: 'CalledProcessError' object has no attribute '_render_traceback_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1101, in get_records
    return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 248, in wrapped
    return f(*args, **kwargs)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 281, in _fixed_getinnerframes
    records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
  File "/usr/lib/python3.8/inspect.py", line 1503, in getinnerframes
    frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
  File "/usr/lib/python3.8/inspect.py", line 1461, in getframeinfo
    filename = getsourcefile(frame) or getfile(frame)
  File "/usr/lib/python3.8/inspect.py", line 708, in getsourcefile
    if getattr(getmodule(object, filename), '__loader__', None) is not None:
  File "/usr/lib/python3.8/inspect.py", line 737, in getmodule
    file = getabsfile(object, _filename)
  File "/usr/lib/python3.8/inspect.py", line 721, in getabsfile
    return os.path.normcase(os.path.abspath(_filename))
  File "/usr/lib/python3.8/posixpath.py", line 379, in abspath
    cwd = os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3437, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-33-067124a5573a>", line 5, in <module>
    subprocess.run(['/home/diegonachon/eye-tracker/edf2asc/edf2asc.exe','/home/diegonachon/eye-tracker/edf2asc/Sujeto1_Control_AS_Todo.EDF'], capture_output = True, check = True)
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/diegonachon/eye-tracker/edf2asc/edf2asc.exe', '/home/diegonachon/eye-tracker/edf2asc/Sujeto1_Control_AS_Todo.EDF']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2061, in showtraceback
    stb = value._render_traceback_()
AttributeError: 'CalledProcessError' object has no attribute '_render_traceback_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3357, in run_ast_nodes
    if (await self.run_code(code, result,  async_=asy)):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3454, in run_code
    self.showtraceback(running_compiled_code=True)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2063, in showtraceback
    stb = self.InteractiveTB.structured_traceback(etype,
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1367, in structured_traceback
    return FormattedTB.structured_traceback(
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1267, in structured_traceback
    return VerboseTB.structured_traceback(
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1124, in structured_traceback
    formatted_exception = self.format_exception_as_a_whole(etype, evalue, etb, number_of_lines_of_context,
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1082, in format_exception_as_a_whole
    last_unique, recursion_repeat = find_recursion(orig_etype, evalue, records)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 382, in find_recursion
    return len(records), 0
TypeError: object of type 'NoneType' has no len()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2061, in showtraceback
    stb = value._render_traceback_()
AttributeError: 'TypeError' object has no attribute '_render_traceback_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1101, in get_records
    return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 248, in wrapped
    return f(*args, **kwargs)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 281, in _fixed_getinnerframes
    records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
  File "/usr/lib/python3.8/inspect.py", line 1503, in getinnerframes
    frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
  File "/usr/lib/python3.8/inspect.py", line 1461, in getframeinfo
    filename = getsourcefile(frame) or getfile(frame)
  File "/usr/lib/python3.8/inspect.py", line 708, in getsourcefile
    if getattr(getmodule(object, filename), '__loader__', None) is not None:
  File "/usr/lib/python3.8/inspect.py", line 737, in getmodule
    file = getabsfile(object, _filename)
  File "/usr/lib/python3.8/inspect.py", line 721, in getabsfile
    return os.path.normcase(os.path.abspath(_filename))
  File "/usr/lib/python3.8/posixpath.py", line 379, in abspath
    cwd = os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3437, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-33-067124a5573a>", line 5, in <module>
    subprocess.run(['/home/diegonachon/eye-tracker/edf2asc/edf2asc.exe','/home/diegonachon/eye-tracker/edf2asc/Sujeto1_Control_AS_Todo.EDF'], capture_output = True, check = True)
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/diegonachon/eye-tracker/edf2asc/edf2asc.exe', '/home/diegonachon/eye-tracker/edf2asc/Sujeto1_Control_AS_Todo.EDF']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2061, in showtraceback
    stb = value._render_traceback_()
AttributeError: 'CalledProcessError' object has no attribute '_render_traceback_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3357, in run_ast_nodes
    if (await self.run_code(code, result,  async_=asy)):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3454, in run_code
    self.showtraceback(running_compiled_code=True)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2063, in showtraceback
    stb = self.InteractiveTB.structured_traceback(etype,
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1367, in structured_traceback
    return FormattedTB.structured_traceback(
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1267, in structured_traceback
    return VerboseTB.structured_traceback(
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1124, in structured_traceback
    formatted_exception = self.format_exception_as_a_whole(etype, evalue, etb, number_of_lines_of_context,
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1082, in format_exception_as_a_whole
    last_unique, recursion_repeat = find_recursion(orig_etype, evalue, records)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 382, in find_recursion
    return len(records), 0
TypeError: object of type 'NoneType' has no len()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2061, in showtraceback
    stb = value._render_traceback_()
AttributeError: 'TypeError' object has no attribute '_render_traceback_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2940, in _run_cell
    return runner(coro)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/async_helpers.py", line 68, in _pseudo_sync_runner
    coro.send(None)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3165, in run_cell_async
    has_raised = await self.run_ast_nodes(code_ast.body, cell_name,
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3376, in run_ast_nodes
    self.showtraceback()
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2063, in showtraceback
    stb = self.InteractiveTB.structured_traceback(etype,
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1367, in structured_traceback
    return FormattedTB.structured_traceback(
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1267, in structured_traceback
    return VerboseTB.structured_traceback(
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1142, in structured_traceback
    formatted_exceptions += self.format_exception_as_a_whole(etype, evalue, etb, lines_of_context,
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1082, in format_exception_as_a_whole
    last_unique, recursion_repeat = find_recursion(orig_etype, evalue, records)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 382, in find_recursion
    return len(records), 0
TypeError: object of type 'NoneType' has no len()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2061, in showtraceback
    stb = value._render_traceback_()
AttributeError: 'TypeError' object has no attribute '_render_traceback_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1101, in get_records
    return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 248, in wrapped
    return f(*args, **kwargs)
  File "/home/diegonachon/eye-tracker/lib/python3.8/site-packages/IPython/core/ultratb.py", line 281, in _fixed_getinnerframes
    records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
  File "/usr/lib/python3.8/inspect.py", line 1503, in getinnerframes
    frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
  File "/usr/lib/python3.8/inspect.py", line 1461, in getframeinfo
    filename = getsourcefile(frame) or getfile(frame)
  File "/usr/lib/python3.8/inspect.py", line 708, in getsourcefile
    if getattr(getmodule(object, filename), '__loader__', None) is not None:
  File "/usr/lib/python3.8/inspect.py", line 737, in getmodule
    file = getabsfile(object, _filename)
  File "/usr/lib/python3.8/inspect.py", line 721, in getabsfile
    return os.path.normcase(os.path.abspath(_filename))
  File "/usr/lib/python3.8/posixpath.py", line 379, in abspath
    cwd = os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory

0 ответов

Другие вопросы по тегам