Pyswip错误:系统无法找到指定的注册表项或值

问题描述 投票:0回答:1

我想在我的项目中使用pyswip。我试图通过Pycharm安装pyswip。它可以成功安装。

  • AS:反向10 64位
  • IDE:Pycharm 2018.3.2
  • 语言:Python 3.7
  • Pyswip版本:0.2.7

问题是当我尝试运行快速运行测试时(以下示例代码来自Pyswip installation guide

from pyswip import Prolog
prolog = Prolog()
prolog.assertz("father(michael,john)")

出现错误

ERROR: The system was unable to find the specified registry key or value.
Traceback (most recent call last):
  File "C:/Users/Coregame/PycharmProjects/Project1/test.py", line 1, in <module>
from pyswip import Prolog
  File "C:\Users\Coregame\PycharmProjects\Project1\venv\lib\site-packages\pyswip\__init__.py", line 29, in <module>
from pyswip.prolog import Prolog
  File "C:\Users\Coregame\PycharmProjects\Project1\venv\lib\site-packages\pyswip\prolog.py", line 28, in <module>
from pyswip.core import *
  File "C:\Users\Coregame\PycharmProjects\Project1\venv\lib\site-packages\pyswip\core.py", line 568, in <module>
(_path, SWI_HOME_DIR) = _findSwipl()
  File "C:\Users\Coregame\PycharmProjects\Project1\venv\lib\site-packages\pyswip\core.py", line 411, in _findSwipl
(path, swiHome) = _findSwiplWin()
  File "C:\Users\Coregame\PycharmProjects\Project1\venv\lib\site-packages\pyswip\core.py", line 208, in _findSwiplWin
    match = pattern.match(ret[-1])
IndexError: list index out of range

我该怎么办?提前致谢!

python prolog pycharm
1个回答
0
投票

您可能使用安装了32位SWI Prolog的64位pyswip。从here安装64位SWI Prolog,它应该可以解决问题,尽管你将无法使用SWI Prolog编辑器。

© www.soinside.com 2019 - 2024. All rights reserved.