title: execute a python project from a node js server
body: <p>I wrote a rather complex algorithm in Python that uses some special libraries that only Python has.
  Now I am trying to write a server in node js that can get Api requests that run my algorithm.
  So I copied the project of the algorithm (which runs fine via Pycharm) to the node's project folder and now it returns an error that it does not recognize the imports that I have in Python's project.
  I'm trying to use the python-shell modules.</p>
  <p>this is TestScript.py:</p>
  <pre><code>import numpy as np
  from algorithm.Version3.FairEnvyFreeAllocationProblem import FairEnvyFreeAllocationProblem
  from algorithm.Version3.FairProportionalAllocationProblem import FairProportionalAllocationProblem
  
  if __name__ == '__main__':
      v =  [[150., 150. ,150. ,150., 150. ,250.],
           [150., 150. ,150. ,150., 150. ,250.],
           [150., 150. ,150. ,150., 150. ,250.]]
  
  
      fpap = FairEnvyFreeAllocationProblem(v)
      ans = fpap.find_allocation_with_min_shering()
      print(ans)
  </code></pre>
  <p>and this is algoController.js:</p>
  <pre><code>const PythonShell = require('python-shell').PythonShell;
  
  const test = () =&gt; {
       PythonShell.run('./src/algorithm/Version3/TestScript.py', null, function (err, results) {
          if (err) throw err;
          console.log(results);
      });
  }
  
  test()
  </code></pre>
  <p>i run :
  <code>node ./src\controllers\algoController.js</code></p>
  <p>and this is the error i get :</p>
  <pre><code>C:\Users\אליהו סתת\Desktop\fair-share-algorithm site\fair-share-algorithm\server\src\controllers\algoController.js:62
          if (err) throw err;                                                                                          
                   ^                                                                                                   
  
  PythonShellError: ModuleNotFoundError: No module named 'algorithm.Version3'; 'algorithm' is not a package
      at PythonShell.parseError (C:\Users\אליהו סתת\Desktop\fair-share-algorithm site\fair-share-algorithm\server\node_modules\python-shell\index.js:295:21)
      at terminateIfNeeded (C:\Users\אליהו סתת\Desktop\fair-share-algorithm site\fair-share-algorithm\server\node_modules\python-shell\index.js:190:32)
      at ChildProcess.&lt;anonymous&gt; (C:\Users\אליהו סתת\Desktop\fair-share-algorithm site\fair-share-algorithm\server\node_modules\python-shell\index.js:182:13)
      at ChildProcess.emit (events.js:314:20)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
      ----- Python Traceback -----
      File &quot;src\algorithm\Version3\TestScript.py&quot;, line 4, in &lt;module&gt;
        from algorithm.Version3.ConsumptionGraph import ConsumptionGraph {
    traceback: 'Traceback (most recent call last):\r\n' +
      '  File &quot;src\\algorithm\\Version3\\TestScript.py&quot;, line 4, in &lt;module&gt;\r\n' +
      '    from algorithm.Version3.ConsumptionGraph import ConsumptionGraph\r\n' +
    executable: 'python',
    options: null,
    script: 'src\\algorithm\\Version3\\TestScript.py',
    args: null,
    exitCode: 1
  }
  PS C:\Users\אליהו סתת\Desktop\fair-share-algorithm site\fair-share-algorithm\server&gt; node ./src\controllers\algoController.js
  in test2
  C:\Users\אליהו סתת\Desktop\fair-share-algorithm site\fair-share-algorithm\server\src\controllers\algoController.js:62                                     
          if (err) throw err;                                                                                                                               
                   ^                                                                                                                                        
                                                                                                                                                            
    args: null,
    exitCode: 1
  }
  
  </code></pre>
  <p>this is where I put the python project (algorithm) in my node server:</p>
  <p><a href="https://i.stack.imgur.com/1BmaX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1BmaX.png" alt="enter image description here" /></a></p>