Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have two versions. How can I tell to pythontex the path to the Python3 to be used if it is possible ?

share|improve this question
How do you do this with a non-TeX way? –  percusse Aug 23 '14 at 9:02
Which operating system do you use, how did you install the various versions of python that are on your system, and what are the versions' numbers. –  Mico Aug 23 '14 at 10:04
Typically, I use Anaconda with Python 3 and Python 2 is the standard one from my distribution. I work on all platforms : Mac O$, Windows and Lubuntu. –  projetmbc Aug 23 '14 at 10:47

1 Answer 1

up vote 5 down vote accepted

See the pythontex documentation (bottom of subsection 2.2 in v0.12?); it lists a number of options that pythontex.py accepts, including the following one, which allows you to specify the interpreter that pythontex should use:


This allows the interpreter for a given language to be specified. The argument should be in the form

--interpreter "<interpreter>:<command>, <interp>:<cmd>, ..."

where <interpreter> is python, ruby, etc., and <command> is the command for invoking the desired interpreter. The argument to --interpreter may also be in the form of a Python dictionary. The argument need not be enclosed in quotation marks if it contains no spaces.

For example, by default Python code is executed with whatever interpreter the python command invokes. But Python 3 could be specified using --interpreter python:python3 (many Linux distributions) or --interpreter "python:py -3" (Windows, with Python 3.3 installed so that the py wrapper is available).

share|improve this answer
Thanks. I really think that the documentation should put this in a dedicated section. –  projetmbc Aug 23 '14 at 11:01
GPoore, the author of pythontex, is active on TeX.SX. I'm sure he'll see your question and he might take your suggestion onboard for a future release. –  Jubobs Aug 23 '14 at 11:06
That was just a suggestion. ;-) –  projetmbc Aug 23 '14 at 14:35
@projetmbc I've added a note about --interpreter to the quickstart for the next release. –  G. Poore Aug 23 '14 at 16:08
Thanks for this and for your package ! –  projetmbc Aug 23 '14 at 17:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.