Alexander's answer was the one got me going. The python.sty file from python.sty on github worked fine when I changed line 61 from:
cat \@pythoninclude\space bin/\jobname.py | python > bin/\jobname.py.out 2> bin/\jobname.py.err
python \jobname.py > \jobname.py.out 2> \jobname.py.err
As you can see I also removed the bin folder. So I also changed line 63 from:
Using this .sty file and adding
-enable-write18 parameter to the command line of
pdflatex worked for me.