我按照README在linux python2.7(ubuntu18)中安装pyclips,但是当"导入clips "时它不起作用,像这样:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "clips/__init__.py", line 36, in <module>
from _clips_wrap import *
File "clips/_clips_wrap.py", line 37, in <module>
import _clips as _c
ImportError: No module named _clips
我跑了这些步骤,我没有做任何其他事情(我还复印了打印出来的字)
(venv) vino@ubuntu:~/Desktop/pych-linux$ cd pyclips-1.0.7.343/
(venv) vino@ubuntu:~/Desktop/pych-linux/pyclips-1.0.7.343$ python setup.py build
Module 'clips': Python to CLIPS interface
Setup revision: $Id: setup.py 342 2008-02-22 01:17:23Z Franz $
finding low-level module symbols... Done!
building environment-aware submodule... Done!
Found CLIPS version: 6.30
'patch' utility found, applying selected patchsets...
Applying patchset 'ia64':
Applying patchset 'bgfx':
Applying patchset 'test':
Creating version number: Standard setup in progress:
running build
running build_py
copying clips/_version.py -> build/lib.linux-x86_64-2.7/clips
copying clips/_eclips_wrap.py -> build/lib.linux-x86_64-2.7/clips
running build_ext
(venv) vino@ubuntu:~/Desktop/pych-linux/pyclips-1.0.7.343$ su -c "python setup.py install">
Module 'clips': Python to CLIPS interface
Setup revision: $Id: setup.py 342 2008-02-22 01:17:23Z Franz $
finding low-level module symbols... Done!
building environment-aware submodule... Done!
Found CLIPS version: 6.30
'patch' utility found, applying selected patchsets...
Applying patchset 'ia64':
Applying patchset 'bgfx':
Applying patchset 'test':
Creating version number: Standard setup in progress:
running install
running build
running build_py
copying clips/_version.py -> build/lib.linux-x86_64-2.7/clips
copying clips/_eclips_wrap.py -> build/lib.linux-x86_64-2.7/clips
running build_ext
running install_lib
copying build/lib.linux-x86_64-2.7/clips/_version.py -> /usr/local/lib/python2.7/dist-packages/clips
copying build/lib.linux-x86_64-2.7/clips/_eclips_wrap.py -> /usr/local/lib/python2.7/dist-packages/clips
byte-compiling /usr/local/lib/python2.7/dist-packages/clips/_version.py to _version.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/clips/_eclips_wrap.py to _eclips_wrap.pyc
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/pyclips-1.0.7.343.egg-info
Writing /usr/local/lib/python2.7/dist-packages/pyclips-1.0.7.343.egg-info
如果你能帮助我,我将非常感激。
pip install——upgrade setuptools
最后一个注意事项,您是否碰巧也在系统中安装了PyCLIPS ?命名空间会发生冲突,因为两个模块都被称为clip。这将解释错误回溯:
Traceback(最近一次调用):文件",第一行,在AttributeError: 'Environment'对象没有属性'assert_string'