title: How to install Python modules in Windows subsystem for Linux?
body: <p>I've used Visual Studio code in Windows to write a number of Python scripts that carry out stochastic simulations of 3 biological systems. I have 6 Python scripts in total, each biological system has a script that simulates the system 5 times in parallel using the Python's multiprocessing library and another script that simulates the system 5 times sequentially.</p>
  <p>However, running the scripts using Visual Studio Code in Windows results in the Sequential scrips always being faster (Not what I want).</p>
  <p>There was some suggestion that the overhead of setting up parallel processes in an IDE might have been my issue. So I ran the scripts in the Windows powershell but the sequential scripts were still faster.</p>
  <p><strong>First question:</strong> Are there any known issues with running parallel simulations in Windows that would explain why the sequential scripts are consistently faster?</p>
  <p>I'm now trying the run the scripts using Windows subsystem for Linux. The scripts use quite a few imports including, numpy, scipy, datetime and multiprocessing. Only when I run the scripts here I get the following error:</p>
  <pre><code>ModuleNotFoundError: No module named 'numpy'
  </code></pre>
  <p><strong>Second question:</strong> How can I install all relevant modules and imports to run my Python scripts in Windows subsystem for Linux.</p>
  <p>The code for the sequential and parallel processes is below if it helps:</p>
  <p><strong>Seqeuntial:</strong></p>
  <pre><code>def repeat_func(times, start_state, LHS, stoch_rate, state_change_array):
      &quot;&quot;&quot; Function to call and run other functions multiple times &quot;&quot;&quot;
      start = datetime.utcnow()
      for i in range(times): 
          popul_num_all, tao_all = gillespie_tau_leaping(start_state, LHS, stoch_rate, state_change_array) 
      end = datetime.utcnow()
      sim_time = end - start
      print(&quot;Simulation time:\n&quot;, sim_time)
  </code></pre>
  <p><strong>Parallel:</strong></p>
  <pre><code>def parallel_func(v):
      gillespie_tau_leaping(start_state, LHS, stoch_rate, state_change_array)
  
  
  if __name__ == '__main__':
      start = datetime.utcnow()
      with Pool() as p:  
          pool_results = p.map(parallel_func, [1, 2, 3, 4, 5])
      end = datetime.utcnow()
      sim_time = end - start
      print(&quot;Simulation time:\n&quot;, sim_time)
  </code></pre>
  <p>Cheers.</p>