title: Using PythonShell module in Nodejs
body: <p>I have been trying to follow the documentation for the npm pythonshell <a href="https://www.npmjs.com/package/python-shell" rel="noreferrer">here</a>. I'm just trying to get a simple example to function correctly with no success, not many examples online but I did try to follow this <a href="https://stackoverflow.com/questions/28713694/running-python-script-in-nodejs#34919496">one on stackoverflow</a>. So what exactly is wrong with my code here? I'm not really sure why I'm getting the below error. I'm far more comfortable in python, nodejs is new territory for me. Thank you for any help.</p>
  
  <p><strong>test.py code:</strong></p>
  
  <pre><code>print("This is a test")
  </code></pre>
  
  <p><strong>Nodejs with pythonshell test:</strong>    </p>
  
  <pre><code>var PythonShell = require('python-shell');
  
      var options = {
        mode: 'text',
        pythonPath: '/bin/bash/python2', 
        pythonOptions: ['-u'],
        scriptPath: './TestProject/',
        args: ['value1', 'value2', 'value3']
      };
  
      PythonShell.run('test.py', options, function (err, results) {
        if (err) throw err;
        // results is an array consisting of messages collected during execution
        console.log('results: %j', results);
      });
  </code></pre>
  
  <p><strong>Here is my error</strong></p>
  
  <pre><code>    internal/child_process.js:313
      throw errnoException(err, 'spawn');
      ^
  
  Error: spawn ENOTDIR
      at exports._errnoException (util.js:1022:11)
      at ChildProcess.spawn (internal/child_process.js:313:11)
      at exports.spawn (child_process.js:387:9)
      at new PythonShell (/home/nomad/TestProject/node_modules/python-shell/index.js:59:25)
      at Function.PythonShell.run (/home/nomad/TestProject/node_modules/python-shell/index.js:159:19)
      at Object.&lt;anonymous&gt; (/home/nomad/TestProject/app.js:11:13)
      at Module._compile (module.js:571:32)
      at Object.Module._extensions..js (module.js:580:10)
      at Module.load (module.js:488:32)
      at tryModuleLoad (module.js:447:12)
  </code></pre>