<div dir="ltr">Hi all,<div><br></div><div>I have used f2py in the past on a Linux machine with virtually no issues. However on my Mac, I get the following error when importing an f2py generated extension:</div><div><br></div>
<div><div>Fatal Python error: PyThreadState_Get: no current thread</div><div>Abort trap: 6</div></div><div><br></div><div>After doing some research I found out that the extension is linked to the wrong python installation:</div>
<div><div><div>otool -L add.so</div><div>add.so:</div><div><span class="" style="white-space:pre">  </span>./add.so (compatibility version 0.0.0, current version 0.0.0)</div><div><span class="" style="white-space:pre">      </span>/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.2)</div>
<div><span class="" style="white-space:pre">    </span>/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)</div></div><div><br></div><div>This seems odd because I am using the f2py executable included in Anaconda 1.9.1. I can easily fix this problem by manually using install_name_tool -change on the extension to link the correct library location, but this is really cumbersome. Is there an alternative solution, such as an additional command-line argument when invoking f2py?</div>
<div><br></div><div>For what it is worth, I am also using Version 14.0.2 of the Intel Fortran Compiler.</div><div><br></div><div>Thanks,</div><div>Alex</div>-- <br><div dir="ltr">Alex Goodman<div>Graduate Research Assistant</div>
<div>Department of Atmospheric Science</div><div>Colorado State University</div></div>
</div></div>