Installing PyCLIPS based on CLIPS 6.30 for Windows Python 2.7 32 bit

1.3k views Asked by At

I learned that there is a version of PyCLIPS based on CLIPS version 6.30. The same (or similar) PyCLIPS version can also be installed via pip, see here.

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. pip install pyclips failed (I suppose due to the missing '-DWIN_MVC' flag, see step 7 below).

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.

What I tried:

  1. git clone https://github.com/almostearthling/pyclips.git
  2. cd pyclips
  3. git checkout pyclips-1.1_clips-6.30
  4. delete the file clipssrc
  5. download the CLIPS 6.30 source code from the official repository
  6. create a new folder a newly created folder clipssrc inside the pyclips folder
  7. extract the contents of the core folder into the clipssrc folder
  8. insetup.py at around line 738, add '-DWIN_MVC' to the CFLAGS list
  9. install patch utility for windows and add it to PATH
  10. start visual studio express 2008 (32 bit) command prompt
  11. cd into the pyclips folder
  12. run python setup.py build
  13. If the built went through (it should) install via python setup.py install

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 2147483648 (sys.maxint+1 on python 2.7 32 bit).

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

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

EDIT 1: I tried to install it with cygwin 32 bit - and it did not 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...

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

Summary:

  • cygwin Python 64 bit, maxint: 9223372036854775807, no error
  • cygwin Python 32 bit, maxint: 2147483647, error
  • Windows Python 2.7 32 bit, maxint: 2147483647, error
  • Windows Python 2.7 64 bit, maxint: 2147483647, error
0

There are 0 answers