如何解决ModuleNotFoundError:没有名为“maraboupy.MarabouCore”的模块
我想在 Kaggle 笔记本上使用 maraboupy python 包。我试过这个:
!git clone https://github.com/NeuralNetworkVerification/Marabou.git
import sys
sys.path.insert(1,'/kaggle/working/Marabou')
但是当我尝试以下代码时,我得到
'ModuleNotFoundError: 没有名为 'maraboupy.MarabouCore' 的模块
from maraboupy import Marabou
Here 是安装指南
根据安装指南,我尝试了以下命令:
mkdir build
cd build
cmake .. -DBUILD_PYTHON=ON
cmake --build .
我明白了:
CMake Error at CMakeLists.txt:239 (target_include_directories): Cannot specify include directories for imported target "openblas".
帮我在 Kaggle 上安装 maraboupy。
解决方法
我不知道细节,但我已经让 maraboupy 在不同的设置中工作。
从 CMake 错误来看,您似乎正在 '/kaggle/working'
中运行安装命令,如果是这样,请尝试在 '/kaggle/working/Marabou'
中运行命令,这至少是我的 CMakeLists.txt 所在的位置。
我能发现的另一个区别是我也将 Marabou 添加到路径中,不知道这是否重要。在你的情况下,我想这将是:
!git clone https://github.com/NeuralNetworkVerification/Marabou.git
import sys
sys.path.insert(1,'/kaggle/working/Marabou/maraboupy')
sys.path.insert(2,'/kaggle/working/Marabou')
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。