问题
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:
- git clone https://github.com/almostearthling/pyclips.git
- cd pyclips
- git checkout pyclips-1.1_clips-6.30
- delete the file
clipssrc
- download the CLIPS 6.30 source code from the official repository
- create a new folder a newly created folder
clipssrc
inside thepyclips
folder - extract the contents of the
core
folder into theclipssrc
folder - in
setup.py
at around line 738, add'-DWIN_MVC'
to theCFLAGS
list - install patch utility for windows and add it to PATH
- start visual studio express 2008 (32 bit) command prompt
- cd into the
pyclips
folder - run
python setup.py build
- 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
来源:https://stackoverflow.com/questions/41407474/installing-pyclips-based-on-clips-6-30-for-windows-python-2-7-32-bit