Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1023586: texlive-extra-utils: pythontex won't find python (when on python3)

183 views
Skip to first unread message

Olivier Berger

unread,
Nov 7, 2022, 3:10:04 AM11/7/22
to
Package: texlive-extra-utils
Version: 2022.20220923-3
Severity: normal

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

-rw-r--r-- 1 root root 1677 Nov 1 15:44 /var/lib/texmf/ls-R
lrwxrwxrwx 1 root root 29 Oct 12 23:25 /usr/share/texmf/ls-R -> /var/lib/texmf/ls-R-TEXMFMAIN
lrwxrwxrwx 1 root root 31 Oct 27 13:51 /usr/share/texlive/texmf-dist/ls-R -> /var/lib/texmf/ls-R-TEXLIVEDIST
lrwxrwxrwx 1 root root 31 Oct 27 13:51 /usr/share/texlive/texmf-dist/ls-R -> /var/lib/texmf/ls-R-TEXLIVEDIST
######################################
Config files
-rw-r--r-- 1 root root 475 Oct 18 08:06 /etc/texmf/web2c/texmf.cnf
lrwxrwxrwx 1 root root 33 Oct 27 13:51 /usr/share/texmf/web2c/fmtutil.cnf -> /var/lib/texmf/fmtutil.cnf-DEBIAN
lrwxrwxrwx 1 root root 32 Oct 27 13:51 /usr/share/texmf/web2c/updmap.cfg -> /var/lib/texmf/updmap.cfg-DEBIAN
-rw-r--r-- 1 root root 2802 Nov 1 15:44 /var/lib/texmf/tex/generic/config/language.dat
######################################
Files in /etc/texmf/web2c/
total 8
-rw-r--r-- 1 root root 283 Sep 4 2021 mktex.cnf
-rw-r--r-- 1 root root 475 Oct 18 08:06 texmf.cnf
######################################
md5sums of texmf.d
ca40c66f144b4bafc3e59a2dd32ecb9c /etc/texmf/texmf.d/00debian.cnf

-- System Information:
Debian Release: bookworm/sid
APT prefers stable-security
APT policy: (500, 'stable-security'), (500, 'testing'), (500, 'stable'), (100, 'bullseye-fasttrack'), (100, 'bullseye-backports-staging')
Architecture: amd64 (x86_64)

Kernel: Linux 6.0.0-2-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages texlive-extra-utils depends on:
ii libunicode-linebreak-perl 0.0.20190101-1+b5
ii python3 3.10.6-1
ii tex-common 6.18
ii texlive-base 2022.20220923-2
ii texlive-binaries 2022.20220321.62855-4
ii texlive-latex-base 2022.20220923-2
ii texlive-luatex 2022.20220923-2
ii texlive-plain-generic 2022.20220923-3

Versions of packages texlive-extra-utils recommends:
ii ghostscript 10.0.0~dfsg-6
ii libfile-homedir-perl 1.006-1
ii liblog-log4perl-perl 1.57-1
ii libyaml-tiny-perl 1.73-1
ii ruby 1:3.0+3.1
ii texlive-latex-recommended 2022.20220923-2

Versions of packages texlive-extra-utils suggests:
pn chktex <none>
ii default-jre-headless 2:1.11-72
pn dvidvi <none>
pn dvipng <none>
pn fragmaster <none>
ii lacheck 1.26-17
pn latexdiff <none>
ii latexmk 1:4.77-1
pn purifyeps <none>
pn xindy <none>

Versions of packages tex-common depends on:
ii ucf 3.0043

Versions of packages tex-common suggests:
ii debhelper 13.10.1

Versions of packages texlive-extra-utils is related to:
ii tex-common 6.18
ii texlive-binaries 2022.20220321.62855-4

-- debconf-show failed

--
Olivier BERGER
https://www-public.imtbs-tsp.eu/~berger_o/ - OpenPGP 2048R/0xF9EAE3A65819D7E8
Ingenieur Recherche - Dept INF
Institut Mines-Telecom, Telecom SudParis, Evry (France)

Norbert Preining

unread,
Nov 7, 2022, 5:20:04 AM11/7/22
to
Hi

something is **rather** strange on your system ...


On Mon, 07 Nov 2022, Olivier Berger wrote:
> 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"'

That is Windows CMD code and nothing even remotely related to Linux.

> This can be addressed by explicitely invoking with:
> pythontex --interpreter python:python3

Maybe also installing
python-is-python3
or how the package name was.

Best

Norbert

--
PREINING Norbert https://www.preining.info
Mercari Inc. + IFMGA Guide + TU Wien + TeX Live
GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13

Olivier Berger

unread,
Nov 7, 2022, 7:00:04 AM11/7/22
to
Hi.

Norbert Preining <prei...@logic.at> writes:

> Hi
>
> something is **rather** strange on your system ...
>

A Debian testing...

>
> On Mon, 07 Nov 2022, Olivier Berger wrote:
>> 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"'
>
> That is Windows CMD code and nothing even remotely related to Linux.
>

Well, I agree it looks fishy, but that's just the error log I
got... so... maybe it's just a wrong error message of some kind ?

>> This can be addressed by explicitely invoking with:
>> pythontex --interpreter python:python3
>
> Maybe also installing
> python-is-python3
> or how the package name was.

That's it.

However, the description states "No packages may declare dependencies on
this package." ... does this include recommends or suggests ?

Thanks for the pointer and feedback anyway.

Best regards,

Hilmar Preuße

unread,
Feb 4, 2023, 10:00:04 AM2/4/23
to
Am 07.11.2022 um 12:38 teilte Olivier Berger mit:
> Norbert Preining <prei...@logic.at> writes:
Hi Olivier,

>>> This can be addressed by explicitely invoking with:
>>> pythontex --interpreter python:python3
>>
>> Maybe also installing
>> python-is-python3
>> or how the package name was.
>
> That's it.
>
> However, the description states "No packages may declare dependencies on
> this package." ... does this include recommends or suggests ?
>
In the Debian package the python interpreter is hard coded to python3 in
the pythontex scripts. Hence I do not really understand, what is going
on here. Could you provide a minimal input file for problem reproduction?

Hilmar

--
sigfault

Olivier Berger

unread,
Feb 8, 2023, 5:20:05 AM2/8/23
to
Hilmar Preuße <hil...@web.de> writes:

> In the Debian package the python interpreter is hard coded to python3 in
> the pythontex scripts. Hence I do not really understand, what is going
> on here. Could you provide a minimal input file for problem reproduction?
>

I'm afraid it's a bit hard for me to find time to prepare that, as I
initially used it inside an Auto-Multiple-Choice exams, which is a
complete mess of its own in terms of providing a minimal reproducible
set (see original report stack traces) :-/

Sorry.

Maybe that'll go away after some time in testing.

Thanks for caring.

Best regards,
0 new messages