intro.tex (Can be skipped...😬)

  • I recently switched from Windows to Linux Mint and just began learning Python. I wanted to make notes/reports using $\LaTeX$ and Python. Having used RSweave for a while now, I wanted something similar to that.

  • On looking up, I found Pweave. I wanted to use noweb code chunk format as it has been adopted from Sweave and I'm already accustomed to that style. I couldn't really comprehend the stuff they have written in the Pweave website.

  • On looking up again, I found this webpage which contains details about installing the Pweave noweb syntax that too in TeXstudio, which I have been using from a quite long time, so I was intrigued.


  • For installing Pweave in my Linux Mint, I have done what all mentioned in the webpage till conda install -n pweave numpy. Now, stuck at Setting up a build command for editor, mainly at populating with actual command. I shall elaborate the issue.
  • For windows, there is a Scripts folder in anaconda3 folder which contains the activate.bat file, but, in Linux Mint, there is no such Scripts folder in anaconda3 folder. On searching for the file, I found a scripts folder in /home/trivikram/anaconda3/pkgs/python-3.6.13-h12debd9_1/lib/python3.6/venv and it contained two sub folders one named common and other named posix, the former contained text file named activate and the later contained activate.csh and activate.fish files.
  • I've tried all the above mentioned three files for the input field in Options > Configure TeXstudio > Build > Use Commands, as mentioned in the webpage, neither of them worked. Here, I attach the screenshot of the error that shows up on running a dummy check.Pnw file. So, which other file I should use for the activation of Pweave?

So, if someone is using Pweave in TexStudio of Linux or someone who knows the corresponding things that should be done to activate such files in Linux Mint, if they can spend some time and answer, I shall be thankful.

Anyways, thanks for reading. Could not start Default Compiler:PdfLaTeX:

  • Not idea of Pweave or python, but RSweave documents actually are not only for R code using knitr (and not the old Sweave), you can also execute python code just adding the option engine=python to the <<>>= line.
    – Fran
    Jun 14 at 10:08
  • That works..!! Thank you very much :D. Actually, I was under assumption that RStudio doesn't support such feature of LaTeX + Python.. So, was searching for TeXstudio. I didn't know about the engine=python .. Thanks again :D Jun 14 at 11:53

1 Answer 1


Knitr can also support chunks of python code with the option engine="python".


<<engine="python", echo=FALSE, fig.cap="Python plot.">>=
import matplotlib.pyplot as plt
X = range(10)
plt.plot(X, [x*x for x in X])


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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