title: FPDF ImportError: No module named fpdf
body: <p>I'm trying to run a python script from PHP. The python script reads the contents from a text file and creates a PDF accordingly. When I run the <code>Python</code> script from terminal, it works perfectly and I get the required PDF as expected. But when I try to run the python script from PHP it gives me the following error: </p>
  
  <pre><code>Traceback (most recent call last): File "/home/amogh/server/test.py", line 3, in from fpdf import FPDF ImportError: No module named fpdf 
  </code></pre>
  
  <p>PHP Code: </p>
  
  <pre><code>&lt;?php
  $output = shell_exec("/home/amogh/server/test.py 2&gt;&amp;1");
  echo $output;
  ?&gt;
  </code></pre>
  
  <p>Python code:</p>
  
  <pre><code>#! /usr/bin/python
  
  from fpdf import FPDF
  fp =  open('downloads/boot.txt', 'r')
  pdf = FPDF()
  pdf.add_page()
  pdf.set_font('Arial', '', 11)
  line = fp.read() 
  pdf.multi_cell(200, 5, line, 0, 1)
  pdf.output('test.pdf', 'F')
  </code></pre>
  
  <p>I've installed <code>fpdf</code> using this command:</p>
  
  <pre><code>pip install fpdf 
  </code></pre>
  
  <p>I'm running my PHP files on <code>lighttpd</code> server. Can anyone tell me where am I going wrong?</p>