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

ε祈祈猫儿з 提交于 2020-01-23 17:19:48

问题


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

来源:https://stackoverflow.com/questions/41407474/installing-pyclips-based-on-clips-6-30-for-windows-python-2-7-32-bit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!