I would like to use PythonTex in Lyx on a Mac. I don't understand the intricacy of Lyx/Tex etc. I think I managed to install PythonLex by installing MacTex 2021 which also installed Tex Live Utility and if I use it to look at packages it also installed pythonlex.
I found this question StackExchange Question
Not sure how I enter the \xxxx statements into a document so tried
Document | Setting | Latex Preamble
And pasted info from article.
When I tried to display the PDF I found it did not like the first two lines with inputenc and fontenc
I would like to be able to enter matplotlib python into my document that display plots & charts, Please advise