TypeError when running Pythonshell on my Mac
<p>I run a python script in node.js using python shell.<br>
On my Windows system everything runs fine.<br>
But running the same thing on my Macbook get's me this error:</p>

<pre><code>Error: TypeError: can't multiply sequence by non-int of type 'float'
    at PythonShell.parseError (/Users/johannes/Dropbox/Javascript Projects/DNA Assembler/Algorithmus_Visualisierung/node_modules/python-shell/index.js:183:17)
    at terminateIfNeeded (/Users/johannes/Dropbox/Javascript Projects/DNA Assembler/Algorithmus_Visualisierung/node_modules/python-shell/index.js:98:28)
    at ChildProcess.&lt;anonymous&gt; (/Users/johannes/Dropbox/Javascript Projects/DNA Assembler/Algorithmus_Visualisierung/node_modules/python-shell/index.js:88:9)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
    ----- Python Traceback -----
    File "Assembler.py", line 224, in &lt;module&gt;
      reads, n, nUnique, nComplements = readReads(path, verbose = True)
    File "Assembler.py", line 20, in readReads
      reads = random.sample(reads, round(len(reads) * subset))
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 326, in sample
      result = [None] * k
</code></pre>

<p>Does someone have an idea what might be going wrong here?<br>
I'm looking for a solution, that does not involve changing a lot in my .py because everything runs fine in Windows. </p>

<p>Solved by changing a float value to int.</p>

<p>(though it would be interesting to know, why this only occurred on Mac.)</p>

javascript python node.js osx typeerror