Pythontex avec TeXShop

Tout ce qui concerne le langage TeX/LaTeX et ses variantes. Ce langage est utilisable sur le forum via les balises tex.
[participation réservée aux utilisateurs inscrits]
Règles du forum
Merci de soigner la rédaction de vos messages et de consulter ce sujet avant de poster. Pensez également à utiliser la fonction recherche du forum.
habibos

Pythontex avec TeXShop

Message non lu par habibos »

Bonjour ,
J'ai un petit soucie, je suis sur Texlive 2019, TeXShop V 4.3 , anaconda3.
Je souhaite utiliser Pythontex , impossible d'obtenir quelque chose.
J'ai d'abord utiliser les indications qui se trouve dans le doc (THE PYTHONTEX ENGINE) ça ne donne rien à la place des résultats j'ai ??
Ensuite j'ai télécharger le fichier Pythontex-platexmkrc.zip et j'ai suivi les indications ,cette fois ci j'ai ce message d'erreur:

Code : Tout sélectionner

[1{/usr/local/texlive/2019/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./testpythontex.aux) ){/usr/local/texlive/2019/texmf-dist/fonts/enc/dvips/lm/l
m-ec.enc}</usr/local/texlive/2019/texmf-dist/fonts/type1/public/lm/lmbx12.pfb><
/usr/local/texlive/2019/texmf-dist/fonts/type1/public/lm/lmr12.pfb>
Output written on testpythontex.pdf (1 page, 36970 bytes).
SyncTeX written on testpythontex.synctex.gz.
Transcript written on testpythontex.log.
=== Pythontex being used
=== Creating rule 'pythontex testpythontex'
Latexmk: Missing input file: 'pythontex-files-testpythontex/testpythontex.pytxmcr' from line
  'No file pythontex-files-testpythontex/testpythontex.pytxmcr.'
Latexmk: Log file says output to 'testpythontex.pdf'
Latexmk: Missing input file: 'pythontex-files-testpythontex/testpythontex.pytxmcr' from line
  'No file pythontex-files-testpythontex/testpythontex.pytxmcr.'
Rule 'pythontex testpythontex': The following rules & subrules became out-of-date:
      'pythontex testpythontex'
------------
Run number 1 of rule 'pythontex testpythontex'
------------
------------
Running 'pythontex --interpreter python:/anaconda3/bin/python  "testpythontex.pytxcode"'
------------
=== TeX engine is 'pdfTeX'
Latexmk: applying rule 'pythontex testpythontex'...
Traceback (most recent call last):
  File "/Library/TeX/texbin/pythontex", line 50, in <module>
    import pythontex2 as pythontex
  File "/usr/local/texlive/2019/texmf-dist/scripts/pythontex/pythontex2.py", line 61, in <module>
    from pygments.styles import get_all_styles
ImportError: No module named pygments.styles
Collected error summary (may duplicate other messages):
  pythontex testpythontex: Command for 'pythontex testpythontex' gave return code 1
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs, or warnings treated as errors.
Latexmk: Errors, so I did not complete making targets

Code : Tout sélectionner

% !TEX program = pdflatexmk
\documentclass[12pt,french]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{babel}
\usepackage{pythontex}
\setlength{\parindent}{0pt}

\begin{document}

\begin{pyverbatim}
import math

def racine(a):
    return math.sqrt(a)

print(racine(9))
\end{pyverbatim}


\bigskip


\begin{pyconsole}
var = 1 + 1
var
\end{pyconsole}
\end{document}
Merci pour votre aide
pzorba75
Utilisateur éprouvé
Utilisateur éprouvé
Messages : 249
Inscription : mardi 20 août 2013, 04:50
Localisation : Paris

Re: Pythontex avec TeXShop

Message non lu par pzorba75 »

Bonjour,
je débute en Python et comme habibos j'essaie d'utiliser Pythontex dans un document Latex. Mon PC est équipé de Windows 10 (à jour régulièrement), de Miktex 2.9, de Python 3.6 (insallé il y a moins d'un an) et je compile mes documents abec TexMaker 5.0.3 (version quasi figée).
Le document que je compile est identique à celui présenté par habibos :

Code : Tout sélectionner

\documentclass[12pt,french]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{babel}
\usepackage{pythontex}

\begin{document}



\begin{pyverbatim}
import math

def racine(a):
    return math.sqrt(a)

print(racine(9))
\end{pyverbatim}


\bigskip


\begin{pyconsole}
var = 1 + 1
var
\end{pyconsole}
\end{document}
En compilant avec "Compilation rapide =Latex+dvips+ps2pdf+viewpdf" la réponse affichée par sumatra dans le pdf est ?? Ptythontx ?? répété deux fois et le fichier log suivant :

Code : Tout sélectionner

This is pdfTeX, Version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6400 64-bit) (preloaded format=latex 2017.9.13)  6 AUG 2019 05:43
entering extended mode
**./Pythontex-1.tex
(Pythontex-1.tex
LaTeX2e <2017-04-15>
Babel <3.12> and hyphenation patterns for 72 language(s) loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size12.clo"
File: size12.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Program Files\MiKTeX 2.9\tex\latex\base\fontenc.sty"
Package: fontenc 2017/04/05 v2.0i Standard LaTeX package

("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1enc.def"
File: t1enc.def 2017/04/05 v2.0i Standard LaTeX file
LaTeX Font Info:    Redeclaring font encoding T1 on input line 48.
))
("C:\Program Files\MiKTeX 2.9\tex\latex\base\inputenc.sty"
Package: inputenc 2015/03/17 v1.2c Input encoding file
\inpenc@prehook=\toks14
\inpenc@posthook=\toks15

("C:\Program Files\MiKTeX 2.9\tex\latex\base\utf8.def"
File: utf8.def 2017/01/28 v1.1t UTF-8 support for inputenc
Now handling font encoding OML ...
... no UTF-8 mapping file for font encoding OML
Now handling font encoding T1 ...
... processing UTF-8 mapping file for font encoding T1

("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1enc.dfu"
File: t1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
   defining Unicode char U+00A0 (decimal 160)
   defining Unicode char U+00A1 (decimal 161)
   defining Unicode char U+00A3 (decimal 163)
   defining Unicode char U+00AB (decimal 171)
   defining Unicode char U+00AD (decimal 173)
   defining Unicode char U+00BB (decimal 187)
   defining Unicode char U+00BF (decimal 191)
   defining Unicode char U+00C0 (decimal 192)
   defining Unicode char U+00C1 (decimal 193)
   defining Unicode char U+00C2 (decimal 194)
   defining Unicode char U+00C3 (decimal 195)
   defining Unicode char U+00C4 (decimal 196)
   defining Unicode char U+00C5 (decimal 197)
   defining Unicode char U+00C6 (decimal 198)
   defining Unicode char U+00C7 (decimal 199)
   defining Unicode char U+00C8 (decimal 200)
   defining Unicode char U+00C9 (decimal 201)
   defining Unicode char U+00CA (decimal 202)
   defining Unicode char U+00CB (decimal 203)
   defining Unicode char U+00CC (decimal 204)
   defining Unicode char U+00CD (decimal 205)
   defining Unicode char U+00CE (decimal 206)
   defining Unicode char U+00CF (decimal 207)
   defining Unicode char U+00D0 (decimal 208)
   defining Unicode char U+00D1 (decimal 209)
   defining Unicode char U+00D2 (decimal 210)
   defining Unicode char U+00D3 (decimal 211)
   defining Unicode char U+00D4 (decimal 212)
   defining Unicode char U+00D5 (decimal 213)
   defining Unicode char U+00D6 (decimal 214)
   defining Unicode char U+00D8 (decimal 216)
   defining Unicode char U+00D9 (decimal 217)
   defining Unicode char U+00DA (decimal 218)
   defining Unicode char U+00DB (decimal 219)
   defining Unicode char U+00DC (decimal 220)
   defining Unicode char U+00DD (decimal 221)
   defining Unicode char U+00DE (decimal 222)
   defining Unicode char U+00DF (decimal 223)
   defining Unicode char U+00E0 (decimal 224)
   defining Unicode char U+00E1 (decimal 225)
   defining Unicode char U+00E2 (decimal 226)
   defining Unicode char U+00E3 (decimal 227)
   defining Unicode char U+00E4 (decimal 228)
   defining Unicode char U+00E5 (decimal 229)
   defining Unicode char U+00E6 (decimal 230)
   defining Unicode char U+00E7 (decimal 231)
   defining Unicode char U+00E8 (decimal 232)
   defining Unicode char U+00E9 (decimal 233)
   defining Unicode char U+00EA (decimal 234)
   defining Unicode char U+00EB (decimal 235)
   defining Unicode char U+00EC (decimal 236)
   defining Unicode char U+00ED (decimal 237)
   defining Unicode char U+00EE (decimal 238)
   defining Unicode char U+00EF (decimal 239)
   defining Unicode char U+00F0 (decimal 240)
   defining Unicode char U+00F1 (decimal 241)
   defining Unicode char U+00F2 (decimal 242)
   defining Unicode char U+00F3 (decimal 243)
   defining Unicode char U+00F4 (decimal 244)
   defining Unicode char U+00F5 (decimal 245)
   defining Unicode char U+00F6 (decimal 246)
   defining Unicode char U+00F8 (decimal 248)
   defining Unicode char U+00F9 (decimal 249)
   defining Unicode char U+00FA (decimal 250)
   defining Unicode char U+00FB (decimal 251)
   defining Unicode char U+00FC (decimal 252)
   defining Unicode char U+00FD (decimal 253)
   defining Unicode char U+00FE (decimal 254)
   defining Unicode char U+00FF (decimal 255)
   defining Unicode char U+0100 (decimal 256)
   defining Unicode char U+0101 (decimal 257)
   defining Unicode char U+0102 (decimal 258)
   defining Unicode char U+0103 (decimal 259)
   defining Unicode char U+0104 (decimal 260)
   defining Unicode char U+0105 (decimal 261)
   defining Unicode char U+0106 (decimal 262)
   defining Unicode char U+0107 (decimal 263)
   defining Unicode char U+0108 (decimal 264)
   defining Unicode char U+0109 (decimal 265)
   defining Unicode char U+010A (decimal 266)
   defining Unicode char U+010B (decimal 267)
   defining Unicode char U+010C (decimal 268)
   defining Unicode char U+010D (decimal 269)
   defining Unicode char U+010E (decimal 270)
   defining Unicode char U+010F (decimal 271)
   defining Unicode char U+0110 (decimal 272)
   defining Unicode char U+0111 (decimal 273)
   defining Unicode char U+0112 (decimal 274)
   defining Unicode char U+0113 (decimal 275)
   defining Unicode char U+0114 (decimal 276)
   defining Unicode char U+0115 (decimal 277)
   defining Unicode char U+0116 (decimal 278)
   defining Unicode char U+0117 (decimal 279)
   defining Unicode char U+0118 (decimal 280)
   defining Unicode char U+0119 (decimal 281)
   defining Unicode char U+011A (decimal 282)
   defining Unicode char U+011B (decimal 283)
   defining Unicode char U+011C (decimal 284)
   defining Unicode char U+011D (decimal 285)
   defining Unicode char U+011E (decimal 286)
   defining Unicode char U+011F (decimal 287)
   defining Unicode char U+0120 (decimal 288)
   defining Unicode char U+0121 (decimal 289)
   defining Unicode char U+0122 (decimal 290)
   defining Unicode char U+0123 (decimal 291)
   defining Unicode char U+0124 (decimal 292)
   defining Unicode char U+0125 (decimal 293)
   defining Unicode char U+0128 (decimal 296)
   defining Unicode char U+0129 (decimal 297)
   defining Unicode char U+012A (decimal 298)
   defining Unicode char U+012B (decimal 299)
   defining Unicode char U+012C (decimal 300)
   defining Unicode char U+012D (decimal 301)
   defining Unicode char U+012E (decimal 302)
   defining Unicode char U+012F (decimal 303)
   defining Unicode char U+0130 (decimal 304)
   defining Unicode char U+0131 (decimal 305)
   defining Unicode char U+0132 (decimal 306)
   defining Unicode char U+0133 (decimal 307)
   defining Unicode char U+0134 (decimal 308)
   defining Unicode char U+0135 (decimal 309)
   defining Unicode char U+0136 (decimal 310)
   defining Unicode char U+0137 (decimal 311)
   defining Unicode char U+0139 (decimal 313)
   defining Unicode char U+013A (decimal 314)
   defining Unicode char U+013B (decimal 315)
   defining Unicode char U+013C (decimal 316)
   defining Unicode char U+013D (decimal 317)
   defining Unicode char U+013E (decimal 318)
   defining Unicode char U+0141 (decimal 321)
   defining Unicode char U+0142 (decimal 322)
   defining Unicode char U+0143 (decimal 323)
   defining Unicode char U+0144 (decimal 324)
   defining Unicode char U+0145 (decimal 325)
   defining Unicode char U+0146 (decimal 326)
   defining Unicode char U+0147 (decimal 327)
   defining Unicode char U+0148 (decimal 328)
   defining Unicode char U+014A (decimal 330)
   defining Unicode char U+014B (decimal 331)
   defining Unicode char U+014C (decimal 332)
   defining Unicode char U+014D (decimal 333)
   defining Unicode char U+014E (decimal 334)
   defining Unicode char U+014F (decimal 335)
   defining Unicode char U+0150 (decimal 336)
   defining Unicode char U+0151 (decimal 337)
   defining Unicode char U+0152 (decimal 338)
   defining Unicode char U+0153 (decimal 339)
   defining Unicode char U+0154 (decimal 340)
   defining Unicode char U+0155 (decimal 341)
   defining Unicode char U+0156 (decimal 342)
   defining Unicode char U+0157 (decimal 343)
   defining Unicode char U+0158 (decimal 344)
   defining Unicode char U+0159 (decimal 345)
   defining Unicode char U+015A (decimal 346)
   defining Unicode char U+015B (decimal 347)
   defining Unicode char U+015C (decimal 348)
   defining Unicode char U+015D (decimal 349)
   defining Unicode char U+015E (decimal 350)
   defining Unicode char U+015F (decimal 351)
   defining Unicode char U+0160 (decimal 352)
   defining Unicode char U+0161 (decimal 353)
   defining Unicode char U+0162 (decimal 354)
   defining Unicode char U+0163 (decimal 355)
   defining Unicode char U+0164 (decimal 356)
   defining Unicode char U+0165 (decimal 357)
   defining Unicode char U+0168 (decimal 360)
   defining Unicode char U+0169 (decimal 361)
   defining Unicode char U+016A (decimal 362)
   defining Unicode char U+016B (decimal 363)
   defining Unicode char U+016C (decimal 364)
   defining Unicode char U+016D (decimal 365)
   defining Unicode char U+016E (decimal 366)
   defining Unicode char U+016F (decimal 367)
   defining Unicode char U+0170 (decimal 368)
   defining Unicode char U+0171 (decimal 369)
   defining Unicode char U+0172 (decimal 370)
   defining Unicode char U+0173 (decimal 371)
   defining Unicode char U+0174 (decimal 372)
   defining Unicode char U+0175 (decimal 373)
   defining Unicode char U+0176 (decimal 374)
   defining Unicode char U+0177 (decimal 375)
   defining Unicode char U+0178 (decimal 376)
   defining Unicode char U+0179 (decimal 377)
   defining Unicode char U+017A (decimal 378)
   defining Unicode char U+017B (decimal 379)
   defining Unicode char U+017C (decimal 380)
   defining Unicode char U+017D (decimal 381)
   defining Unicode char U+017E (decimal 382)
   defining Unicode char U+01CD (decimal 461)
   defining Unicode char U+01CE (decimal 462)
   defining Unicode char U+01CF (decimal 463)
   defining Unicode char U+01D0 (decimal 464)
   defining Unicode char U+01D1 (decimal 465)
   defining Unicode char U+01D2 (decimal 466)
   defining Unicode char U+01D3 (decimal 467)
   defining Unicode char U+01D4 (decimal 468)
   defining Unicode char U+01E2 (decimal 482)
   defining Unicode char U+01E3 (decimal 483)
   defining Unicode char U+01E6 (decimal 486)
   defining Unicode char U+01E7 (decimal 487)
   defining Unicode char U+01E8 (decimal 488)
   defining Unicode char U+01E9 (decimal 489)
   defining Unicode char U+01EA (decimal 490)
   defining Unicode char U+01EB (decimal 491)
   defining Unicode char U+01F0 (decimal 496)
   defining Unicode char U+01F4 (decimal 500)
   defining Unicode char U+01F5 (decimal 501)
   defining Unicode char U+0218 (decimal 536)
   defining Unicode char U+0219 (decimal 537)
   defining Unicode char U+021A (decimal 538)
   defining Unicode char U+021B (decimal 539)
   defining Unicode char U+0232 (decimal 562)
   defining Unicode char U+0233 (decimal 563)
   defining Unicode char U+1E02 (decimal 7682)
   defining Unicode char U+1E03 (decimal 7683)
   defining Unicode char U+200C (decimal 8204)
   defining Unicode char U+2010 (decimal 8208)
   defining Unicode char U+2011 (decimal 8209)
   defining Unicode char U+2012 (decimal 8210)
   defining Unicode char U+2013 (decimal 8211)
   defining Unicode char U+2014 (decimal 8212)
   defining Unicode char U+2015 (decimal 8213)
   defining Unicode char U+2018 (decimal 8216)
   defining Unicode char U+2019 (decimal 8217)
   defining Unicode char U+201A (decimal 8218)
   defining Unicode char U+201C (decimal 8220)
   defining Unicode char U+201D (decimal 8221)
   defining Unicode char U+201E (decimal 8222)
   defining Unicode char U+2030 (decimal 8240)
   defining Unicode char U+2031 (decimal 8241)
   defining Unicode char U+2039 (decimal 8249)
   defining Unicode char U+203A (decimal 8250)
   defining Unicode char U+2423 (decimal 9251)
   defining Unicode char U+1E20 (decimal 7712)
   defining Unicode char U+1E21 (decimal 7713)
)
Now handling font encoding OT1 ...
... processing UTF-8 mapping file for font encoding OT1

("C:\Program Files\MiKTeX 2.9\tex\latex\base\ot1enc.dfu"
File: ot1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
   defining Unicode char U+00A0 (decimal 160)
   defining Unicode char U+00A1 (decimal 161)
   defining Unicode char U+00A3 (decimal 163)
   defining Unicode char U+00AD (decimal 173)
   defining Unicode char U+00B8 (decimal 184)
   defining Unicode char U+00BF (decimal 191)
   defining Unicode char U+00C5 (decimal 197)
   defining Unicode char U+00C6 (decimal 198)
   defining Unicode char U+00D8 (decimal 216)
   defining Unicode char U+00DF (decimal 223)
   defining Unicode char U+00E6 (decimal 230)
   defining Unicode char U+00EC (decimal 236)
   defining Unicode char U+00ED (decimal 237)
   defining Unicode char U+00EE (decimal 238)
   defining Unicode char U+00EF (decimal 239)
   defining Unicode char U+00F8 (decimal 248)
   defining Unicode char U+0131 (decimal 305)
   defining Unicode char U+0141 (decimal 321)
   defining Unicode char U+0142 (decimal 322)
   defining Unicode char U+0152 (decimal 338)
   defining Unicode char U+0153 (decimal 339)
   defining Unicode char U+0174 (decimal 372)
   defining Unicode char U+0175 (decimal 373)
   defining Unicode char U+0176 (decimal 374)
   defining Unicode char U+0177 (decimal 375)
   defining Unicode char U+0218 (decimal 536)
   defining Unicode char U+0219 (decimal 537)
   defining Unicode char U+021A (decimal 538)
   defining Unicode char U+021B (decimal 539)
   defining Unicode char U+2013 (decimal 8211)
   defining Unicode char U+2014 (decimal 8212)
   defining Unicode char U+2018 (decimal 8216)
   defining Unicode char U+2019 (decimal 8217)
   defining Unicode char U+201C (decimal 8220)
   defining Unicode char U+201D (decimal 8221)
)
Now handling font encoding OMS ...
... processing UTF-8 mapping file for font encoding OMS

("C:\Program Files\MiKTeX 2.9\tex\latex\base\omsenc.dfu"
File: omsenc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
   defining Unicode char U+00A7 (decimal 167)
   defining Unicode char U+00B6 (decimal 182)
   defining Unicode char U+00B7 (decimal 183)
   defining Unicode char U+2020 (decimal 8224)
   defining Unicode char U+2021 (decimal 8225)
   defining Unicode char U+2022 (decimal 8226)
)
Now handling font encoding OMX ...
... no UTF-8 mapping file for font encoding OMX
Now handling font encoding U ...
... no UTF-8 mapping file for font encoding U
   defining Unicode char U+00A9 (decimal 169)
   defining Unicode char U+00AA (decimal 170)
   defining Unicode char U+00AE (decimal 174)
   defining Unicode char U+00BA (decimal 186)
   defining Unicode char U+02C6 (decimal 710)
   defining Unicode char U+02DC (decimal 732)
   defining Unicode char U+200C (decimal 8204)
   defining Unicode char U+2026 (decimal 8230)
   defining Unicode char U+2122 (decimal 8482)
   defining Unicode char U+2423 (decimal 9251)
))
("C:\Program Files\MiKTeX 2.9\tex\latex\lm\lmodern.sty"
Package: lmodern 2009/10/30 v1.6 Latin Modern Fonts
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  OT1/cmr/m/n --> OT1/lmr/m/n on input line 22.
LaTeX Font Info:    Overwriting symbol font `letters' in version `normal'
(Font)                  OML/cmm/m/it --> OML/lmm/m/it on input line 23.
LaTeX Font Info:    Overwriting symbol font `symbols' in version `normal'
(Font)                  OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24.
LaTeX Font Info:    Overwriting symbol font `largesymbols' in version `normal'
(Font)                  OMX/cmex/m/n --> OMX/lmex/m/n on input line 25.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26.
LaTeX Font Info:    Overwriting symbol font `letters' in version `bold'
(Font)                  OML/cmm/b/it --> OML/lmm/b/it on input line 27.
LaTeX Font Info:    Overwriting symbol font `symbols' in version `bold'
(Font)                  OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28.
LaTeX Font Info:    Overwriting symbol font `largesymbols' in version `bold'
(Font)                  OMX/cmex/m/n --> OMX/lmex/m/n on input line 29.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `normal'
(Font)                  OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `normal'
(Font)                  OT1/cmss/m/n --> OT1/lmss/m/n on input line 32.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `normal'
(Font)                  OT1/cmr/m/it --> OT1/lmr/m/it on input line 33.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `normal'
(Font)                  OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `bold'
(Font)                  OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `bold'
(Font)                  OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `bold'
(Font)                  OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `bold'
(Font)                  OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38.
)
("C:\Program Files\MiKTeX 2.9\tex\generic\babel\babel.sty"
Package: babel 2017/06/29 3.12 The Babel package

("C:\Program Files\MiKTeX 2.9\tex\generic\babel\switch.def"
File: switch.def 2017/06/29 3.12 Babel switching mechanism
)
*************************************
* Local config file bblopts.cfg used
*
("C:\Program Files\MiKTeX 2.9\tex\latex\arabi\bblopts.cfg"
File: bblopts.cfg 2005/09/08 v0.1 add Arabic and Farsi to "declared" options of
 babel
)
("C:\Program Files\MiKTeX 2.9\tex\generic\babel-french\frenchb.ldf"
Language: frenchb 2017/09/07 v3.3c French support from the babel system

("C:\Program Files\MiKTeX 2.9\tex\generic\babel-french\french.ldf"
Language: french 2017/09/07 v3.3c French support from the babel system

("C:\Program Files\MiKTeX 2.9\tex\generic\babel\babel.def"
File: babel.def 2017/06/29 3.12 Babel common definitions

("C:\Program Files\MiKTeX 2.9\tex\generic\babel\switch.def"
File: switch.def 2017/06/29 3.12 Babel switching mechanism
)
\babel@savecnt=\count87
\U@D=\dimen103
)
\FB@nonchar=\count88
\FBcolonsp=\toks16
\FBthinsp=\toks17
Package babel Info: Making : an active character on input line 322.
Package babel Info: Making ; an active character on input line 323.
Package babel Info: Making ! an active character on input line 324.
Package babel Info: Making ? an active character on input line 325.
\FBguillsp=\toks18
\FBguill@level=\count89
\FB@everypar=\toks19
\FB@Mht=\dimen104
\mc@charclass=\count90
\mc@charfam=\count91
\mc@charslot=\count92
\std@mcc=\count93
\dec@mcc=\count94
\c@FBcaption@count=\count95
\listindentFB=\skip43
\descindentFB=\skip44
\labelwidthFB=\skip45
\leftmarginFB=\skip46
\parindentFFN=\dimen105
\FBfnindent=\skip47
)))
("C:\Program Files\MiKTeX 2.9\tex\latex\carlisle\scalefnt.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty"
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks20
)
("C:\Program Files\MiKTeX 2.9\tex\latex\pythontex\pythontex.sty"
Package: pythontex 2017/07/20 v0.16 execute and typeset Python code and other l
anguages

("C:\Program Files\MiKTeX 2.9\tex\latex\fvextra\fvextra.sty"
Package: fvextra 2019/02/04 v1.4 fvextra - extensions and patches for fancyvrb

("C:\Program Files\MiKTeX 2.9\tex\latex\base\ifthen.sty"
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
("C:\Program Files\MiKTeX 2.9\tex\latex\etoolbox\etoolbox.sty"
Package: etoolbox 2017/01/02 v2.4 e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count96
)
("C:\Program Files\MiKTeX 2.9\tex\latex\fancyvrb\fancyvrb.sty"
Package: fancyvrb 2008/02/07

Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix 
<2008/02/07> (tvz)
\FV@CodeLineNo=\count97
\FV@InFile=\read1
\FV@TabBox=\box26
\c@FancyVerbLine=\count98
\FV@StepNumber=\count99
\FV@OutFile=\write3
) ("C:\Program Files\MiKTeX 2.9\tex\latex\upquote\upquote.sty"
Package: upquote 2012/04/19 v1.3 upright-quote and grave-accent glyphs in verba
tim
 ("C:\Program Files\MiKTeX 2.9\tex\latex\base\textcomp.sty"
Package: textcomp 2017/04/05 v2.0i Standard LaTeX package
Package textcomp Info: Sub-encoding information:
(textcomp)               5 = only ISO-Adobe without \textcurrency
(textcomp)               4 = 5 + \texteuro
(textcomp)               3 = 4 + \textohm
(textcomp)               2 = 3 + \textestimated + \textcurrency
(textcomp)               1 = TS1 - \textcircled - \t
(textcomp)               0 = TS1 (full)
(textcomp)             Font families with sub-encoding setting implement
(textcomp)             only a restricted character set as indicated.
(textcomp)             Family '?' is the default used for unknown fonts.
(textcomp)             See the documentation for details.
Package textcomp Info: Setting ? sub-encoding to TS1/1 on input line 79.

("C:\Program Files\MiKTeX 2.9\tex\latex\base\ts1enc.def"
File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
Now handling font encoding TS1 ...
... processing UTF-8 mapping file for font encoding TS1

("C:\Program Files\MiKTeX 2.9\tex\latex\base\ts1enc.dfu"
File: ts1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
   defining Unicode char U+00A2 (decimal 162)
   defining Unicode char U+00A3 (decimal 163)
   defining Unicode char U+00A4 (decimal 164)
   defining Unicode char U+00A5 (decimal 165)
   defining Unicode char U+00A6 (decimal 166)
   defining Unicode char U+00A7 (decimal 167)
   defining Unicode char U+00A8 (decimal 168)
   defining Unicode char U+00A9 (decimal 169)
   defining Unicode char U+00AA (decimal 170)
   defining Unicode char U+00AC (decimal 172)
   defining Unicode char U+00AE (decimal 174)
   defining Unicode char U+00AF (decimal 175)
   defining Unicode char U+00B0 (decimal 176)
   defining Unicode char U+00B1 (decimal 177)
   defining Unicode char U+00B2 (decimal 178)
   defining Unicode char U+00B3 (decimal 179)
   defining Unicode char U+00B4 (decimal 180)
   defining Unicode char U+00B5 (decimal 181)
   defining Unicode char U+00B6 (decimal 182)
   defining Unicode char U+00B7 (decimal 183)
   defining Unicode char U+00B9 (decimal 185)
   defining Unicode char U+00BA (decimal 186)
   defining Unicode char U+00BC (decimal 188)
   defining Unicode char U+00BD (decimal 189)
   defining Unicode char U+00BE (decimal 190)
   defining Unicode char U+00D7 (decimal 215)
   defining Unicode char U+00F7 (decimal 247)
   defining Unicode char U+0192 (decimal 402)
   defining Unicode char U+02C7 (decimal 711)
   defining Unicode char U+02D8 (decimal 728)
   defining Unicode char U+02DD (decimal 733)
   defining Unicode char U+0E3F (decimal 3647)
   defining Unicode char U+2016 (decimal 8214)
   defining Unicode char U+2020 (decimal 8224)
   defining Unicode char U+2021 (decimal 8225)
   defining Unicode char U+2022 (decimal 8226)
   defining Unicode char U+2030 (decimal 8240)
   defining Unicode char U+2031 (decimal 8241)
   defining Unicode char U+203B (decimal 8251)
   defining Unicode char U+203D (decimal 8253)
   defining Unicode char U+2044 (decimal 8260)
   defining Unicode char U+204E (decimal 8270)
   defining Unicode char U+2052 (decimal 8274)
   defining Unicode char U+20A1 (decimal 8353)
   defining Unicode char U+20A4 (decimal 8356)
   defining Unicode char U+20A6 (decimal 8358)
   defining Unicode char U+20A9 (decimal 8361)
   defining Unicode char U+20AB (decimal 8363)
   defining Unicode char U+20AC (decimal 8364)
   defining Unicode char U+20B1 (decimal 8369)
   defining Unicode char U+2103 (decimal 8451)
   defining Unicode char U+2116 (decimal 8470)
   defining Unicode char U+2117 (decimal 8471)
   defining Unicode char U+211E (decimal 8478)
   defining Unicode char U+2120 (decimal 8480)
   defining Unicode char U+2122 (decimal 8482)
   defining Unicode char U+2126 (decimal 8486)
   defining Unicode char U+2127 (decimal 8487)
   defining Unicode char U+212E (decimal 8494)
   defining Unicode char U+2190 (decimal 8592)
   defining Unicode char U+2191 (decimal 8593)
   defining Unicode char U+2192 (decimal 8594)
   defining Unicode char U+2193 (decimal 8595)
   defining Unicode char U+2329 (decimal 9001)
   defining Unicode char U+232A (decimal 9002)
   defining Unicode char U+2422 (decimal 9250)
   defining Unicode char U+25E6 (decimal 9702)
   defining Unicode char U+25EF (decimal 9711)
   defining Unicode char U+266A (decimal 9834)
))
LaTeX Info: Redefining \oldstylenums on input line 334.
Package textcomp Info: Setting cmr sub-encoding to TS1/0 on input line 349.
Package textcomp Info: Setting cmss sub-encoding to TS1/0 on input line 350.
Package textcomp Info: Setting cmtt sub-encoding to TS1/0 on input line 351.
Package textcomp Info: Setting cmvtt sub-encoding to TS1/0 on input line 352.
Package textcomp Info: Setting cmbr sub-encoding to TS1/0 on input line 353.
Package textcomp Info: Setting cmtl sub-encoding to TS1/0 on input line 354.
Package textcomp Info: Setting ccr sub-encoding to TS1/0 on input line 355.
Package textcomp Info: Setting ptm sub-encoding to TS1/4 on input line 356.
Package textcomp Info: Setting pcr sub-encoding to TS1/4 on input line 357.
Package textcomp Info: Setting phv sub-encoding to TS1/4 on input line 358.
Package textcomp Info: Setting ppl sub-encoding to TS1/3 on input line 359.
Package textcomp Info: Setting pag sub-encoding to TS1/4 on input line 360.
Package textcomp Info: Setting pbk sub-encoding to TS1/4 on input line 361.
Package textcomp Info: Setting pnc sub-encoding to TS1/4 on input line 362.
Package textcomp Info: Setting pzc sub-encoding to TS1/4 on input line 363.
Package textcomp Info: Setting bch sub-encoding to TS1/4 on input line 364.
Package textcomp Info: Setting put sub-encoding to TS1/5 on input line 365.
Package textcomp Info: Setting uag sub-encoding to TS1/5 on input line 366.
Package textcomp Info: Setting ugq sub-encoding to TS1/5 on input line 367.
Package textcomp Info: Setting ul8 sub-encoding to TS1/4 on input line 368.
Package textcomp Info: Setting ul9 sub-encoding to TS1/4 on input line 369.
Package textcomp Info: Setting augie sub-encoding to TS1/5 on input line 370.
Package textcomp Info: Setting dayrom sub-encoding to TS1/3 on input line 371.
Package textcomp Info: Setting dayroms sub-encoding to TS1/3 on input line 372.

Package textcomp Info: Setting pxr sub-encoding to TS1/0 on input line 373.
Package textcomp Info: Setting pxss sub-encoding to TS1/0 on input line 374.
Package textcomp Info: Setting pxtt sub-encoding to TS1/0 on input line 375.
Package textcomp Info: Setting txr sub-encoding to TS1/0 on input line 376.
Package textcomp Info: Setting txss sub-encoding to TS1/0 on input line 377.
Package textcomp Info: Setting txtt sub-encoding to TS1/0 on input line 378.
Package textcomp Info: Setting lmr sub-encoding to TS1/0 on input line 379.
Package textcomp Info: Setting lmdh sub-encoding to TS1/0 on input line 380.
Package textcomp Info: Setting lmss sub-encoding to TS1/0 on input line 381.
Package textcomp Info: Setting lmssq sub-encoding to TS1/0 on input line 382.
Package textcomp Info: Setting lmvtt sub-encoding to TS1/0 on input line 383.
Package textcomp Info: Setting lmtt sub-encoding to TS1/0 on input line 384.
Package textcomp Info: Setting qhv sub-encoding to TS1/0 on input line 385.
Package textcomp Info: Setting qag sub-encoding to TS1/0 on input line 386.
Package textcomp Info: Setting qbk sub-encoding to TS1/0 on input line 387.
Package textcomp Info: Setting qcr sub-encoding to TS1/0 on input line 388.
Package textcomp Info: Setting qcs sub-encoding to TS1/0 on input line 389.
Package textcomp Info: Setting qpl sub-encoding to TS1/0 on input line 390.
Package textcomp Info: Setting qtm sub-encoding to TS1/0 on input line 391.
Package textcomp Info: Setting qzc sub-encoding to TS1/0 on input line 392.
Package textcomp Info: Setting qhvc sub-encoding to TS1/0 on input line 393.
Package textcomp Info: Setting futs sub-encoding to TS1/4 on input line 394.
Package textcomp Info: Setting futx sub-encoding to TS1/4 on input line 395.
Package textcomp Info: Setting futj sub-encoding to TS1/4 on input line 396.
Package textcomp Info: Setting hlh sub-encoding to TS1/3 on input line 397.
Package textcomp Info: Setting hls sub-encoding to TS1/3 on input line 398.
Package textcomp Info: Setting hlst sub-encoding to TS1/3 on input line 399.
Package textcomp Info: Setting hlct sub-encoding to TS1/5 on input line 400.
Package textcomp Info: Setting hlx sub-encoding to TS1/5 on input line 401.
Package textcomp Info: Setting hlce sub-encoding to TS1/5 on input line 402.
Package textcomp Info: Setting hlcn sub-encoding to TS1/5 on input line 403.
Package textcomp Info: Setting hlcw sub-encoding to TS1/5 on input line 404.
Package textcomp Info: Setting hlcf sub-encoding to TS1/5 on input line 405.
Package textcomp Info: Setting pplx sub-encoding to TS1/3 on input line 406.
Package textcomp Info: Setting pplj sub-encoding to TS1/3 on input line 407.
Package textcomp Info: Setting ptmx sub-encoding to TS1/4 on input line 408.
Package textcomp Info: Setting ptmj sub-encoding to TS1/4 on input line 409.
))
("C:\Program Files\MiKTeX 2.9\tex\latex\lineno\lineno.sty"
Package: lineno 2005/11/02 line numbers on paragraphs v4.41
\linenopenalty=\count100
\output=\toks21
\linenoprevgraf=\count101
\linenumbersep=\dimen106
\linenumberwidth=\dimen107
\c@linenumber=\count102
\c@pagewiselinenumber=\count103
\c@LN@truepage=\count104
\c@internallinenumber=\count105
\c@internallinenumbers=\count106
\quotelinenumbersep=\dimen108
\bframerule=\dimen109
\bframesep=\dimen110
\bframebox=\box27
LaTeX Info: Redefining \\ on input line 3056.
)
\c@FV@TrueTabGroupLevel=\count107
\c@FV@TrueTabCounter=\count108
\FV@TabBox@Group=\box28
\FV@TmpLength=\skip48
\c@FV@HighlightLinesStart=\count109
\c@FV@HighlightLinesStop=\count110
\FV@LoopCount=\count111
\FV@NCharsBox=\box29
\FV@BreakIndent=\dimen111
\FV@BreakIndentNChars=\count112
\FV@BreakSymbolSepLeft=\dimen112
\FV@BreakSymbolSepLeftNChars=\count113
\FV@BreakSymbolSepRight=\dimen113
\FV@BreakSymbolSepRightNChars=\count114
\FV@BreakSymbolIndentLeft=\dimen114
\FV@BreakSymbolIndentLeftNChars=\count115
\FV@BreakSymbolIndentRight=\dimen115
\FV@BreakSymbolIndentRightNChars=\count116
\c@FancyVerbLineBreakLast=\count117
\FV@LineBox=\box30
\FV@LineIndentBox=\box31
\FV@LineWidth=\dimen116
)
("C:\Program Files\MiKTeX 2.9\tex\latex\xstring\xstring.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\xstring\xstring.tex"
\integerpart=\count118
\decimalpart=\count119
)
Package: xstring 2019/02/06 v1.83 String manipulations (CT)
)
("C:\Program Files\MiKTeX 2.9\tex\latex\pgfopts\pgfopts.sty"
Package: pgfopts 2014/07/10 v2.1a LaTeX package options with pgfkeys

("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\utilities\pgfkeys.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\utilities\pgfkeys.code.tex"
\pgfkeys@pathtoks=\toks22
\pgfkeys@temptoks=\toks23

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\utilities\pgfkeysfiltered.code.te
x"
\pgfkeys@tmptoks=\toks24
)))
\pgfopts@list@add@a@toks=\toks25
\pgfopts@list@add@b@toks=\toks26
) ("C:\Program Files\MiKTeX 2.9\tex\latex\caption\newfloat.sty"
Package: newfloat 2018/03/04 v1.1a Defining new floating environments (AR)
)
("C:\Program Files\MiKTeX 2.9\tex\latex\currfile\currfile.sty"
Package: currfile 2015/04/23 v0.7c Provides the file path elements of the curre
nt input file

("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty"
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\kvsetkeys.sty"
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\etexcmds.sty"
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty"
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
Package etexcmds Info: Could not find \expanded.
(etexcmds)             That can mean that you are not using pdfTeX 1.50 or
(etexcmds)             that some package has redefined \expanded.
(etexcmds)             In the latter case, load this package earlier.
)))
("C:\Program Files\MiKTeX 2.9\tex\latex\filehook\filehook.sty"
Package: filehook 2011/10/12 v0.5d Hooks for input files
)
\c@currfiledepth=\count120
)
\pytx@codefile=\write4
\openout4 = `Pythontex-1.pytxcode'.

\c@pytx@FancyVerbLineTemp=\count121
\c@pytx@py@default@default=\count122
\c@pytx@pycon@default@default=\count123
\c@pytx@sympy@default@default=\count124
\c@pytx@sympycon@default@default=\count125
\c@pytx@pylab@default@default=\count126
\c@pytx@pylabcon@default@default=\count127
)
("C:\Program Files\MiKTeX 2.9\tex\latex\xcolor\xcolor.sty"
Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK)

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-cfg\color.cfg"
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: dvips.def on input line 225.

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-def\dvips.def"
File: dvips.def 2017/06/20 v3.1d Graphics/color driver for dvips
)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1348.
Package xcolor Info: Model `RGB' extended on input line 1364.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1366.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1367.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1368.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1369.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1370.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1371.
)
(Pythontex-1.aux)
\openout1 = `Pythontex-1.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 8.
LaTeX Font Info:    Try loading font information for TS1+cmr on input line 8.
 ("C:\Program Files\MiKTeX 2.9\tex\latex\base\ts1cmr.fd"
File: ts1cmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions
)
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Try loading font information for T1+lmr on input line 8.

("C:\Program Files\MiKTeX 2.9\tex\latex\lm\t1lmr.fd"
File: t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
LaTeX Info: Redefining \degres on input line 8.
LaTeX Info: Redefining \dots on input line 8.
LaTeX Info: Redefining \up on input line 8.

No file pythontex-files-Pythontex-1/Pythontex-1.pytxmcr.
Run PythonTeX to create it.
Package newfloat Info: New float `listing' with options `fileext=lopytx' on inp
ut line 8.
\c@listing=\count128
\newfloat@ftype=\count129
Package newfloat Info: float type `listing'=8 on input line 8.
\c@pytx@py@default@defaultverb=\count130
\c@pytx@py@default@defaultverb@line=\count131

Package PythonTeX Warning: Non-existent Pygments content on input line 19.

\c@pytx@pycon@default@default@line=\count132

Package PythonTeX Warning: Non-existent console content on input line 28.

[1

] (Pythontex-1.aux) ) 
Here is how much of TeX's memory you used:
 6669 strings out of 493353
 109980 string characters out of 3139729
 199374 words of memory out of 3000000
 10117 multiletter control sequences out of 15000+200000
 10699 words of font info for 18 fonts, out of 3000000 for 9000
 1127 hyphenation exceptions out of 8191
 47i,5n,42p,830b,423s stack positions out of 5000i,500n,10000p,200000b,50000s

Output written on Pythontex-1.dvi (1 page, 468 bytes).
[/quote]

En compilant avec PDFLatex, le résultat affiché est identique à la compilation précédente, le fichier log est en pièce jointe, je ne peux pas le placer dans le message qui dépasserait 60.000 caractères
[quote]This is pdfTeX, Version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6400 64-bit) (preloaded format=pdflatex 2017.12.2)  6 AUG 2019 05:46
entering extended mode
**./Pythontex-1.tex
(Pythontex-1.tex
LaTeX2e <2017-04-15>
Babel <3.12> and hyphenation patterns for 72 language(s) loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size12.clo"
File: size12.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)

(Pythontex-1.aux)
\openout1 = `Pythontex-1.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 8.
LaTeX Font Info:    Try loading font information for TS1+cmr on input line 8.
 ("C:\Program Files\MiKTeX 2.9\tex\latex\base\ts1cmr.fd"
File: ts1cmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions
)
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Try loading font information for T1+lmr on input line 8.

("C:\Program Files\MiKTeX 2.9\tex\latex\lm\t1lmr.fd"
File: t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
LaTeX Info: Redefining \degres on input line 8.
LaTeX Info: Redefining \dots on input line 8.
LaTeX Info: Redefining \up on input line 8.

No file pythontex-files-Pythontex-1/Pythontex-1.pytxmcr.
Run PythonTeX to create it.
Package newfloat Info: New float `listing' with options `fileext=lopytx' on inp
ut line 8.
\c@listing=\count128
\newfloat@ftype=\count129
Package newfloat Info: float type `listing'=8 on input line 8.
("C:\Program Files\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count130
\scratchdimen=\dimen117
\scratchbox=\box32
\nofMPsegments=\count131
\nofMParguments=\count132
\everyMPshowfont=\toks27
\MPscratchCnt=\count133
\MPscratchDim=\dimen118
\MPnumerator=\count134
\makeMPintoPDFobject=\count135
\everyMPtoPDFconversion=\toks28
)
\c@pytx@py@default@defaultverb=\count136
\c@pytx@py@default@defaultverb@line=\count137


Package PythonTeX Warning: Non-existent Pygments content on input line 19.

\c@pytx@pycon@default@default@line=\count138

Package PythonTeX Warning: Non-existent console content on input line 28.

[1

{C:/Users/pzorba75/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
(Pythontex-1.aux) ) 
Here is how much of TeX's memory you used:
 7024 strings out of 493352
 114629 string characters out of 3139703
 200802 words of memory out of 3000000
 10466 multiletter control sequences out of 15000+200000
 10699 words of font info for 18 fonts, out of 3000000 for 9000
 1127 hyphenation exceptions out of 8191
 47i,5n,42p,830b,423s stack positions out of 5000i,500n,10000p,200000b,50000s
{C:/Program Files/MiKTeX 2.9/fonts/enc/dvips/lm/lm-ec.enc}<C
:/Program Files/MiKTeX 2.9/fonts/type1/public/lm/lmbx12.pfb><C:/Program Files/M
iKTeX 2.9/fonts/type1/public/lm/lmr12.pfb>
Output written on Pythontex-1.pdf (1 page, 37881 bytes).
PDF statistics:
 15 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

Pythontex-1.log
(38.12 Kio) Téléchargé 290 fois
Je suis complètement bloqué ne voyant pas du tout l'origine de cette anomalie. J'indique que j'ai'installé le package pygments en suivant la procédure Python pip

Code : Tout sélectionner

C:\Users\pzorba75\AppData\Local\Programs\Python\Python36>python -m pip show --verbose pygments
Name: Pygments
Version: 2.4.2
Summary: Pygments is a syntax highlighting package written in Python.
Home-page: http://pygments.org/
Author: Georg Brandl
Author-email: georg@python.org
License: BSD License
Location: c:\users\pzorba75\appdata\local\programs\python\python36\lib\site-packages
Requires:
Required-by:
Metadata-Version: 2.1
Installer: pip
Classifiers:
  License :: OSI Approved :: BSD License
  Intended Audience :: Developers
  Intended Audience :: End Users/Desktop
  Intended Audience :: System Administrators
  Development Status :: 6 - Mature
  Programming Language :: Python
  Programming Language :: Python :: 2
  Programming Language :: Python :: 2.7
  Programming Language :: Python :: 3
  Programming Language :: Python :: 3.5
  Programming Language :: Python :: 3.6
  Programming Language :: Python :: 3.7
  Operating System :: OS Independent
  Topic :: Text Processing :: Filters
  Topic :: Utilities
Entry-points:
  [console_scripts]
  pygmentize = pygments.cmdline:main
Tout cela est un peu long, j'espère qu'une personne utilisant Pythontex pourra voir où ce trouve l'erreur et m'indiquer comment corriger ce qui ne va pas.
D'avance merci beaucoup.

Pierre
On se lasse de tout, excepté d'apprendre.
Virgile
marco56
Utilisateur chevronné
Utilisateur chevronné
Messages : 1136
Inscription : jeudi 25 novembre 2010, 22:10

Re: Pythontex avec TeXShop

Message non lu par marco56 »

Pas le temps de chercher les erreurs.
Par contre, j'insère depuis de nombreuses années du code Python dans mes docs Tex : est-ce l'objectif ?
Si oui, il y a de nombreuses possibilités.
Un exemple (ce n'est pas du python mais pas grave) :

Code : Tout sélectionner

    \documentclass{article}

    \usepackage{listings}
    \usepackage{xcolor}
    \usepackage[frenchb]{babel}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage{textcomp}
    \definecolor{darkgreen}{rgb}{0, 0.6, 0}
    \lstset{language = caml, frameround = fttt}

    \lstset{upquote=true,
            columns=flexible,
            keepspaces=true,
            breaklines,
            breakindent=0pt,
            basicstyle=\ttfamily,
            breaklines=true,
            keywordstyle=\color{red},
            commentstyle=\color{darkgreen},
            tabsize=2,
            escapeinside={;;}{¤},
            escapebegin=;;\endgraf\color{gray},
            }

    \begin{document}
    \begin{lstlisting}[caption = la fonction factorielle, frame = trBL]
    let rec factorielle = fun
       |0 -> 0
       |n -> n*(factorielle (n-1));;
    factorielle : int -> int = <fun>¤
    let rec factorielle = fun
       |0 -> 0
       |n -> n*(factorielle (n-1));;
    factorielle : int -> int = <fun>
    \end{lstlisting}
    \end{document}
Il y a aussi moyen de générer des fichiers pdf grâce à un programme python qui crée le fichier tex et compile.
Un fichier tex peut aussi faire appel à un programme python pour effectuer des calculs.
pzorba75
Utilisateur éprouvé
Utilisateur éprouvé
Messages : 249
Inscription : mardi 20 août 2013, 04:50
Localisation : Paris

Re: Pythontex avec TeXShop

Message non lu par pzorba75 »

L'idée d'utiliser PythonTx est de documenter les solutions d'exercices impliquant Python, pricipalement des algorithmes avec une application numérique. J'ai essayé ce package en pensant que je pourrai obtenir le source mis en forme et avec les couleurs des éditeurs (IDLE Python ou PyScripter) et la console Python bien pratique pour des scripts Pyhton niveau "Débutants Lycée", tout cela en une enchaînement allant de la compilation Latex à la production du fichier pdf en sortie, sans avoir besoin de bricoler des images par copier-coller, imagmagik pour convertir en eps et includegraphics.
Pythontex est-il le bon outil? En parcourant la documentation et en fouinant dans google +pythontex, j'ai l'impression que c'est l'outil le mieux adapté. SAns vraiment obtenir d'exemple proche de ce que je cherche à réaliser.
La conséquence : il faut le faire fonctionner sur mon environnement et cela n'est pas vraiment simple.
Voilà où j'en suis.
En essayant lstings à partir de votre réponse et en bricolant language=Python, j'obtiens bien le fichier pdf, mais le document Python semble ignoré,la colorisation des mots clés semble prise en compte. Je n'ai pas trouvé comment indiquer Python dans la documentation de listings sur ctan.org.
Espérant avoir indiqué le sens de mes recherches.
On se lasse de tout, excepté d'apprendre.
Virgile
marco56
Utilisateur chevronné
Utilisateur chevronné
Messages : 1136
Inscription : jeudi 25 novembre 2010, 22:10

Re: Pythontex avec TeXShop

Message non lu par marco56 »

On peut faire ceci mais il faut compiler en shell-escape pour donner la main à un programme externe :

Code : Tout sélectionner

% A compiler avec :
%latex -shell-escape %.tex
\documentclass[11pt,a4paper,landscape]{article} 
\usepackage[utf8x]{inputenc}			% Utilisation du UTF8
%\usepackage[latin1]{inputenc}
\usepackage{textcomp}				% Accents dans les titres
\usepackage[francais]{babel}           		% Titres en français

\usepackage [T1]{fontenc} 			      % Correspondance clavier -> document

\usepackage{graphicx}
\usepackage{python}
\usepackage{xcolor}
\usepackage{listings}

\usepackage{geometry}
\geometry{lmargin=1.3cm,rmargin=1.3cm,tmargin=0.7cm,bmargin=0.7cm}

\usepackage{url}
%\url{URL} : équivalent à \href{URL}{URL} 

% prise en charge des liens hypertextes
\usepackage[backref,linktocpage=true,colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=blue,dvips,bookmarks=true,pagebackref,breaklinks]{hyperref}
%\usepackage{hyperref}
\newcommand{\email}[1]{\href{mailto:#1}{\nolinkurl{#1}}}
\urlstyle{sf}

\lstset{upquote=true,
columns=flexible,
keepspaces=true,
breaklines,
breakindent=0pt,
basicstyle=\ttfamily,
breaklines=true,
keywordstyle=\color{red},
commentstyle=\color{darkgreen},
tabsize=2,
escapechar={¤},
escapebegin=\color{gray},
}

\begin{document}
\lstnewenvironment{python_list}{\lstset{frame=single,backgroundcolor=\color{lightgray},linewidth=\textwidth}}{}


Exemple avec listing à améliorer sans doute.\\
Pour échanger : \email{marc.beutier@laposte.net} ou \email{obelix56@free.fr}\\


\begin{figure}
\centering
\begin{python}
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from pylab import *

figure(figsize=(8,5), dpi=80)
subplot(111)

X = np.linspace(-np.pi, np.pi, 256,endpoint=True)
C,S = np.cos(X), np.sin(X)

plot(X, C, color="blue", linewidth=2.5, linestyle="-")
plot(X, S, color="red", linewidth=2.5, linestyle="--")

ax = gca()
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.spines['bottom'].set_position(('data',0))
ax.yaxis.set_ticks_position('left')
ax.spines['left'].set_position(('data',0))

xlim(X.min()*1.1, X.max()*1.1)
xticks([-np.pi, -np.pi/2, 0, np.pi/2, np.pi],
[r'$-\pi$', r'$-\pi/2$', r'$0$', r'$+\pi/2$', r'$+\pi$'])

ylim(C.min()*1.1,C.max()*1.1)
yticks([-1, 0, +1],[r'$-1$', r'$0$', r'$+1$'])

# Pour sauvegarder la figure sous forme d'image
savefig('essay-pyth12.eps', dpi=100)

# Pour afficher le graphe sur une autre fenetre
#show()

\end{python}
\label{figure quelconque}
\caption{figure quelconque}
\end{figure}


\begin{minipage}{0.5\linewidth}
\begin{python_list}
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from pylab import *

figure(figsize=(8,5), dpi=80)
subplot(111)

X = np.linspace(-np.pi, np.pi, 256,endpoint=True)
C,S = np.cos(X), np.sin(X)

plot(X, C, color="blue", linewidth=2.5, linestyle="-")
plot(X, S, color="red", linewidth=2.5, linestyle="--")

ax = gca()
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.spines['bottom'].set_position(('data',0))
ax.yaxis.set_ticks_position('left')
ax.spines['left'].set_position(('data',0))

xlim(X.min()*1.1, X.max()*1.1)
xticks([-np.pi, -np.pi/2, 0, np.pi/2, np.pi],
[r'$-\pi$', r'$-\pi/2$', r'$0$', r'$+\pi/2$', r'$+\pi$'])

ylim(C.min()*1.1,C.max()*1.1)
yticks([-1, 0, +1],[r'$-1$', r'$0$', r'$+1$'])

# Pour sauvegarder la figure sous forme d'image
savefig('essay-pyth12.eps', dpi=100)

# Pour afficher le graphe sur une autre fenetre
#show()
\end{python_list}
\end{minipage}\hfill
\begin{minipage}{0.05\linewidth}
\end{minipage}\hfill
\begin{minipage}{0.45\linewidth}
\includegraphics[width=13cm]{essay-pyth12.eps}
\end{minipage}\hfill
\end{document}
Est-ce que cela répond à ton problème ?
Cela génère le pdf en PJ.

Pour lstset :
https://en.wikibooks.org/wiki/LaTeX/Sou ... e_Listings

Au cas où, voici ce que je fais comme doc : http://obelix56.free.fr/spip.php?article5

[Edit] J'ai retrouvé cela dans mes docs aussi :

Code : Tout sélectionner

%latex -shell-escape %.tex
\documentclass{article}
\usepackage{graphicx}
\usepackage{python}
\begin{document}

Blabla

\begin{figure}
\centering
\begin{python}
#!/usr/bin/env python
"""
You can control the axis tick and grid properties
"""

from pylab import *
t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
plot(t, s)
grid(True)

# MATLAB style
xticklines = getp(gca(), 'xticklines')
yticklines = getp(gca(), 'yticklines')
xgridlines = getp(gca(), 'xgridlines')
ygridlines = getp(gca(), 'ygridlines')
xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
setp(xticklines, 'linewidth', 3)
setp(yticklines, 'linewidth', 3)
setp(xgridlines, 'linestyle', '-')
setp(ygridlines, 'linestyle', '-')
setp(yticklabels, 'color', 'r', fontsize='medium')
setp(xticklabels, 'color', 'r', fontsize='medium')
savefig('figure1.eps', dpi=100)

\end{python}

\end{figure}
%sur l'autre pc (pc1), à la place de "savefig('figure1.eps', dpi=100)", il y avait :
%fig1 = plt.gcf()
%#plt.show() plt.draw() si on veut afficher les graphes
%fig1.savefig('figure1.eps', dpi=100)
%mais cela ne marche pas sur pc2 !

\includegraphics[scale=0.5]{figure1.eps}

Et encore blabla
\end{document}
Pièces jointes
essay-pyth12.pdf
(30.3 Kio) Téléchargé 314 fois
pzorba75
Utilisateur éprouvé
Utilisateur éprouvé
Messages : 249
Inscription : mardi 20 août 2013, 04:50
Localisation : Paris

Re: Pythontex avec TeXShop

Message non lu par pzorba75 »

C'est bien ce que je cherche à faire, malheureusement j'ai une erreur de compilation avec le fichier que j'ai récupéré. Une histoire d'encodage UTF8 qui me passe au dessus des oreilles.
Je mets les dernières lignes de la log obtenue en recompilant avex Latex, option comportant de shall escape au niveau des paramètres dans Texmaker.

Code : Tout sélectionner

! Package ucs Error: Unknown Unicode character 65533 = U+FFFD,
(ucs)                possibly declared in uni-255.def.
(ucs)                Type H to see if it is available with options.

See the ucs package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.46 Exemple avec listing à am
                              eliorer sans doute.\\
Unicode character 65533 = U+FFFD:
REPLACEMENT CHARACTER
Character is not defined in uni-*.def files.
Enter I!<RET> to define the glyph.


! Package utf8x Error: MalformedUTF-8sequence.

See the utf8x package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.47 Pour éch
             anger : \email{marc.beutier@laposte.net} ou \email{obelix56@fre...

Ifthecharacterisanargument,putitin{}


! Package utf8x Error: MalformedUTF-8sequence.

See the utf8x package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.47 Pour éch
             anger : \email{marc.beutier@laposte.net} ou \email{obelix56@fre...

Ifthecharacterisanargument,putitin{}


Package ucs Warning: Unknown character 65533 = 0xFFFD appeared again. on input 
line 47.

LaTeX Font Info:    Try loading font information for T1+cmss on input line 47.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1cmss.fd"
File: t1cmss.fd 2014/09/29 v2.5h Standard LaTeX font definitions
)
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <10.95> on input line 47.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <8> on input line 47.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <6> on input line 47.

Underfull \hbox (badness 10000) in paragraph at lines 46--48

 []

\openout3 = `Pythontex-2.py'.

\openout4 = `latex.py'.

runsystem(cat  Pythontex-2.py | python > Pythontex-2.py.out 2> Pythontex-2.py.e
rr)...executed.

! I can't find file `Pythontex-2.py.out'.
<to be read again> 
                   \def 
l.88 \end{python}
                 
Please type another input file name
! Emergency stop.
<to be read again> 
                   \def 
l.88 \end{python}
                 
*** (job aborted, file error in nonstop mode)

 
Here is how much of TeX's memory you used:
 9155 strings out of 493353
 134172 string characters out of 3139729
 243464 words of memory out of 3000000
 12588 multiletter control sequences out of 15000+200000
 8089 words of font info for 26 fonts, out of 3000000 for 9000
 1127 hyphenation exceptions out of 8191
 32i,2n,35p,371b,481s stack positions out of 5000i,500n,10000p,200000b,50000s
No pages of output.
Je ne sais pas comment changer le code du fichier Pythontex-2.tex pour essayer de régler ce problème.
Merci pour l'exemple.
Pierre
On se lasse de tout, excepté d'apprendre.
Virgile
habibos

Re: Pythontex avec TeXShop

Message non lu par habibos »

merci mais impossible de compiler.
Effectivement je souhaite intégrer du code python mais pas en utilisant Listings, je souhaiterais pouvoir utiliser Pythontex sauf que je ne comprends pas pourquoi je n'y arrive pas à compiler et pourtant j'ai suivie toutes les indications :cry:
marco56
Utilisateur chevronné
Utilisateur chevronné
Messages : 1136
Inscription : jeudi 25 novembre 2010, 22:10

Re: Pythontex avec TeXShop

Message non lu par marco56 »

Re.
J'ai oublié une chose : pour avoir la figure, il faut d'abord compiler le fichier python :

Code : Tout sélectionner

##!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from pylab import *

figure(figsize=(8,5), dpi=80)
subplot(111)

X = np.linspace(-np.pi, np.pi, 256,endpoint=True)
C,S = np.cos(X), np.sin(X)

plot(X, C, color="blue", linewidth=2.5, linestyle="-")
plot(X, S, color="red", linewidth=2.5, linestyle="--")

ax = gca()
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.spines['bottom'].set_position(('data',0))
ax.yaxis.set_ticks_position('left')
ax.spines['left'].set_position(('data',0))

xlim(X.min()*1.1, X.max()*1.1)
xticks([-np.pi, -np.pi/2, 0, np.pi/2, np.pi],
[r'$-\pi$', r'$-\pi/2$', r'$0$', r'$+\pi/2$', r'$+\pi$'])

ylim(C.min()*1.1,C.max()*1.1)
yticks([-1, 0, +1],[r'$-1$', r'$0$', r'$+1$'])

# Pour sauvegarder la figure sous forme d'image
savefig('essay-pyth12.eps', dpi=100)
Ensuite, il faut que le fichier tex soit encodé en utf8 également.
J'ai d'ailleurs modifié ma ligne 4 :

Code : Tout sélectionner

\usepackage[utf8]{inputenc}	
Je suis sur Ubuntu et je n'ai pas testé sur Windows...
Peut-être en mettant en latin1 ou windows1252 ?
evariste_G
Utilisateur chevronné
Utilisateur chevronné
Messages : 1481
Inscription : vendredi 19 décembre 2008, 19:13
Statut actuel : Enseignant
Localisation : Bordeaux
Contact :

Re: Pythontex avec TeXShop

Message non lu par evariste_G »

Bonjour.

Je suis sous TexMaker, et j'utilise la chaîne suivante pour interpréter le premier code donné :

Code : Tout sélectionner

\documentclass[12pt,french]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{babel}
\usepackage{pythontex}
\setlength{\parindent}{0pt}

\begin{document}

\begin{pyverbatim}
import math

def racine(a):
    return math.sqrt(a)

print(racine(9))
\end{pyverbatim}

\bigskip

\begin{pyconsole}
var = 1 + 1
var
\end{pyconsole}
\end{document}

Code : Tout sélectionner

pdflatex --shell-escape -synctex=1 -interaction=nonstopmode %.tex|python C:\Users\Toto\AppData\Local\Programs\MiKTeX\scripts\pythontex\pythontex.py %.tex|pdflatex --shell-escape -synctex=1 -interaction=nonstopmode %.tex
Perso, j'ai mis cette chaîne en Commande utilisateur (menu Utilisateur).

Bien sûr, la syntaxe n'est sans doute pas la même avec les autres éditeurs, mais là, il faudra regarder la doc de votre éditeur pour l'adapter.
Il faut aussi s'assurer que python soit bien dans le PATH et adapter les chemins en fonction de ce qu'il y a sur votre ordinateur.

J'obtiens le PDF ci-joint.
temp.pdf
(60.41 Kio) Téléchargé 385 fois
Mathématiques, LaTeX et Python : https://www.mathweb.fr
Cours particuliers de maths par webcam: https://courspasquet.fr
Trouver un vrai prof pour des cours particuliers: https://lesvraisprofs.mathweb.fr/
Répondre
  • Sujets similaires
    Réponses
    Vues
    Dernier message