Installing PyCLIPS based on CLIPS 6.30 for Windows Python 2.7 32 bit
<p>I learned that <a href="https://github.com/almostearthling/pyclips/tree/pyclips-1.1_clips-6.30" rel="nofollow noreferrer">there is</a> a version of PyCLIPS based on CLIPS version 6.30.
The same (or similar) PyCLIPS version can also be installed via pip, <a href="https://python.packagedb.info/pypi/pyclips" rel="nofollow noreferrer">see here</a>.</p>

<p>On Linux, both approaches work fine, i.e. installing via git clone + setup.py, or via pip. On Windows, it worked only with cygwin 64bit. <code>pip install pyclips</code> failed (I suppose due to the missing '-DWIN_MVC' flag, see step 7 below).</p>

<p>However, I would like to have a PyCLIPS based on CLIPS 6.30 on a 'regular' Windows python, to be precise Python2.7 32 bit on a Windows 7 64 bit. I have visual studio express 2008 installed.</p>

<p>What I tried:</p>

<ol>
<li>git clone <a href="https://github.com/almostearthling/pyclips.git" rel="nofollow noreferrer">https://github.com/almostearthling/pyclips.git</a></li>
<li>cd pyclips</li>
<li>git checkout pyclips-1.1_clips-6.30</li>
<li>delete the file <code>clipssrc</code></li>
<li>download the CLIPS 6.30 source code from the <a href="https://sourceforge.net/projects/clipsrules/files/CLIPS/6.30/" rel="nofollow noreferrer">official repository</a></li>
<li>create a new folder a newly created folder <code>clipssrc</code> inside the <code>pyclips</code> folder</li>
<li>extract the contents of the <code>core</code> folder into the <code>clipssrc</code> folder</li>
<li>in<code>setup.py</code> at around line 738, add <code>'-DWIN_MVC'</code> to the <code>CFLAGS</code> list</li>
<li>install patch utility for windows and add it to PATH</li>
<li>start visual studio express 2008 (32 bit) command prompt</li>
<li>cd into the <code>pyclips</code> folder</li>
<li>run <code>python setup.py build</code></li>
<li>If the built went through (it should) install via <code>python setup.py install</code></li>
</ol>

<p>Although the built and installation went through, large integers still cause an error, as they did in CLIPS before version 6.30. This means CLIPS is not able to cope with integers that are larger than <code>2147483648</code> (<code>sys.maxint+1</code> on python 2.7 32 bit).</p>

<p>During compilation with visual studio 2008 I got the Warning "<code>conversion from '__int64' to 'long', possible loss of data</code>". I changed the types of the corresponding variables to <code>long long</code>. The Warnings disappeared but the error with large integers still exists.</p>

<p><strong>How do I install PyCLIPS based on CLIPS 6.30 on Windows 7 64 bit for use with a 32bit Windows Python 2.7 ?</strong></p>

<p>EDIT 1:
I tried to install it with cygwin 32 bit - and it did <em>not</em> work. So maybe it is a 32/64 bit issue? The 32bit Version of clips (installed via the official installer) works fine on my Windows 7 64 bit...</p>

<p>EDIT 2:
It seems to work with python interpreters that have a sys.maxint of <code>9223372036854775807</code> but not with interpreters that have a sys.maxint of <code>2147483647</code>. Interestingly, even the 64bit Windows Python has the latter value.</p>

<p>Summary:</p>

<ul>
<li>cygwin Python 64 bit, maxint: 9223372036854775807, no error</li>
<li>cygwin Python 32 bit, maxint: 2147483647, <strong>error</strong> </li>
<li>Windows Python 2.7 32 bit, maxint: 2147483647, <strong>error</strong> </li>
<li>Windows Python 2.7 64 bit, maxint: 2147483647, <strong>error</strong></li>
</ul>