无法导入本地模块
所以我试图在我的计算机上使用这个存储库,但我似乎无法导入本地模块(Agent.pyx)并使用该文件中的函数。我得到的错误是: ModuleNotFoundError:没有名为“RLAgent.Agent”的模块
错误屏幕截图 存储库链接
So I am trying to use this repository on my computer but I cant seem to import a local module (Agent.pyx) and use functions from that file. The error I get is:ModuleNotFoundError: No module named 'RLAgent.Agent
Screenshot of error
Link to repository
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须手动安装软件包
You have to install the package manually
由于
Agent.pyx
是一个.pyx
文件,因此您需要首先构建它。链接存储库中的自述文件也提到了这一点。因此,您需要移至 RLAgent 目录并执行设置指令,如下所示:这将构建所需的
.c
和.so
文件,然后将其导入到其他文件中例如Train.py
,这是导入抛出错误的地方。Since
Agent.pyx
is a.pyx
file, you will need to first build it. The README file in the linked repo also mentions this. So you need to move to the RLAgent directory and execute the setup instruction as:This will build the required
.c
and.so
file which will then enable it's import in other files such asTrain.py
which is where the import is throwing an error.