title: Running Bash commands in Python
body: <p>On my local machine, I run a python script which contains this line</p>
  
  <pre><code>bashCommand = "cwm --rdf test.rdf --ntriples &gt; test.nt"
  os.system(bashCommand)
  </code></pre>
  
  <p>This works fine.</p>
  
  <p>Then I run the same code on a server and I get the following error message</p>
  
  <pre><code>'import site' failed; use -v for traceback
  Traceback (most recent call last):
  File "/usr/bin/cwm", line 48, in &lt;module&gt;
  from swap import  diag
  ImportError: No module named swap
  </code></pre>
  
  <p>So what I did then is I inserted a <code>print bashCommand</code> which prints me than the command in the terminal before it runs it with <code>os.system()</code>.</p>
  
  <p>Of course, I get again the error (caused by <code>os.system(bashCommand)</code>) but before that error it prints the command in the terminal. Then I just copied that output and did a copy paste into the terminal and hit enter and it works...</p>
  
  <p>Does anyone have a clue what's going on?</p>