Hi.
When testing the use of pythontex in the context of auto-multiple-choice, I stumbled upon the fact that apparently pythontex won't find python:
This is PythonTeX 0.18
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/share/texlive/texmf-dist/scripts/pythontex/pythontex3.py", line 1569, in run_code
proc = subprocess.Popen(exec_cmd, stdout=out_file, stderr=err_file)
File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1847, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'python'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.10/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/share/texlive/texmf-dist/scripts/pythontex/pythontex3.py", line 1583, in run_code
proc = subprocess.Popen(exec_cmd_string, stdout=out_file, stderr=err_file)
File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1847, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmd /C "@echo off & call python pythontex-files-amc-compiled/py_default_default.py & if errorlevel 1 exit 1"'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/bin/pythontex", line 62, in <module>
pythontex.main()
File "/usr/share/texlive/texmf-dist/scripts/pythontex/pythontex3.py", line 2828, in main
do_multiprocessing(data, temp_data, old_data, engine_dict)
File "/usr/share/texlive/texmf-dist/scripts/pythontex/pythontex3.py", line 1390, in do_multiprocessing
result = task.get()
File "/usr/lib/python3.10/multiprocessing/pool.py", line 774, in get
raise self._value
FileNotFoundError: [Errno 2] No such file or directory: 'cmd /C "@echo off & call python pythontex-files-amc-compiled/py_default_default.py & if errorlevel 1 exit 1"'
Indeed:
$ type python
bash: type: python: not found
This can be addressed by explicitely invoking with:
pythontex --interpreter python:python3
I guess this could probably be improved to avoid users having to figure out themselves.
Hope this helps,
##################################
minimal input file
##################################
other files
######################################
List of ls-R files