title: OSX using swi-prolog pyswip package for python
body: <p>I was trying to execute a third party prolog program for my research. In the meanwhile, I discovered that it requires the pyswip package to execute, due to the program declaration</p>
  
  <pre><code>from pyswip import Prolog
  </code></pre>
  
  <p>So, after installing this package following the instructions in the INSTALL file, in the root folder of the pyswip installation, the package still could no be found, as with the output error:</p>
  
  <pre><code>ImportError: Could not find the SWI-Prolog library in this platform. If you are sure it is installed, please open an issue.
  </code></pre>
  
  <p>So after some investigation, I've discovered that the use of the package from python is called from the core.py file, in my case located at</p>
  
  <pre><code>/Library/Python/2.7/site-packages/pyswip
  </code></pre>
  
  <p>So analyzing this file I could locate the output error text and conclude that the path was not being found according with the specific line</p>
  
  <pre><code>elif platform == "dar":  # Help with MacOS is welcome!!
  </code></pre>
  
  <p>So I noticed too that comment to help with MacOS. Inside the method that tries to found the path properly</p>
  
  <pre><code>(path, swiHome) = _findSwiplDar()
  </code></pre>
  
  <p>I noticed two array: one with two candidate names of package names and another with the path's candidates. So I've located the first package name "libswipl.dylib" doing a search on my OSX. Finishing, I've added the specific package path to the path array, and everything is working now.</p>
  
  <p>I know this is not the best solution, but I've discovered how things are working and resolved the issue. If someone knows a better way to configure this kind of library without updating the core.py file, I'll be glad to know ;-)</p>
  
  <p>I hope this helps someone!</p>