Bug#737376: texlive-extra-utils: Debian pythontex can't use python3
On Wed, Feb 12, 2014 at 07:33:01AM +0900, Norbert Preining wrote:
> > Much more interesting would be if the /usr/bin/pythontex3 were to
> > include the argument --interpreter python:python3 before "$@", for
>
> Did you see the scripts I have added to the texlive-extra tree
> and that will be installed?
> texlive-nonbin.git/texlive-extra-debian/pythontex3
> is nothing else but:
> if which python3 >/dev/null 2>&1
> then
> python3 /usr/share/texlive/texmf-dist/scripts/pythontex/pythontex3.py "$@"
> else
> echo "You need to have python3 installed to be able to use" >&2
> echo "the Python 3 version of pythontex!" >&2
> echo "Exiting." >&2
> fi
>
> That is why I wrote in the last email that I used your script, but changed
> the exec to a call to python3 ...
Indeed. I wrote that script before I understood what pythontex3 did.
Geoffrey wrote to me (but forgot to copy in the bug report):
>> Julian,
>>
>> In the latest beta relase, I've modified the hashbangs in
>> `pythontex2.py` and `pythontex3.py` to `env python2` and `env
>> python3`. If no bugs are found in the next several days, I will
>> release to CTAN and then it will be available for TeX Live.
>>
>> One thing I forgot to mention. The version of Python that launches
>> PythonTeX is primarily used to manage/oversee code execution...and
>> this version doesn't really matter (except for highlighting and
>> console emulation). The version of Python that is actually used to
>> run user code from the document is determined by what `python` gives
>> on the command line. This can be customized with the `--interpreter`
>> option. For example, `pythontex --interpreter python:python3
>> file.tex` would call the temporary scripts that PythonTeX uses with
>> `python3 <temp_script>`.
>>
>> Geoff
So...
> That should suffice, though, right?
So in its current form it doesn't actually achieve anything of value.
But changing the call to read:
python3 /usr/share/texlive/texmf-dist/scripts/pythontex/pythontex3.py \
--interpreter python:python3 "$@"
would actually make it do what people would expect, which is to use
python3 to process the code in the LaTeX document.
Julian
Reply to: