ModulenotFoundError:No模块名为' pygimli'

发布于 2025-02-12 13:57:33 字数 567 浏览 1 评论 0原文

我在Jupyter笔记本上导入Pygimli时遇到困难。我按建议在

conda activate pg

因此,我相信它应该可以使用(我对obspy也这样做,它像魅力一样工作!)。

我找到了一个测试命令来查看安装是否正确:

python -c "import pygimli; pygimli.test(show=False, onlydoctests=True)"

根据命令,我会得到2个失败,但是我并没有真正遇到造成麻烦的原因,也没有得到解决问题的方法。这是我在终端上发生故障的两个屏幕截图:

失败的第一个屏幕截图

href =“ https://i.sstatic.net/cejne.png” rel =“ nofollow noreferrer“>失败的第二个屏幕截图

I'm having trouble importing pyGIMLI on Jupyter Notebook. I installed it as recommended on https://www.pygimli.org/installation.html by creating a new environment and the installation went smoothly. However when I try to import it on Jupyter Notebook it cannot load it and I get : "ModuleNotFoundError: No module named 'pygimli'". I launch Jupyter using the terminal after typing the command :

conda activate pg

so I believe it should work (I do the same for Obspy and it works like a charm!).

I found a test command to see if the installation went correctly :

python -c "import pygimli; pygimli.test(show=False, onlydoctests=True)"

I get 2 failures according to the command, however I don't really get what's causing trouble, nor do I get how to solve the problem. Here are two screenshots of the failures I get on the terminal :

First screenshot of the failures

Second screenshot of the failures

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泅渡 2025-02-19 13:57:33

我刚刚发现了问题是什么:我忘了在新环境中安装iPykernel。我可以使用以下问题解决我的问题:

conda install nb_conda
conda install ipykernel
python -m ipykernel install --user --name mykernel

对不起我的愚蠢问题,并感谢那些已经对我的Quesiton发表评论的人!

I just found out what the problem was : I forgot to install ipykernel in the new environment. I could solve my issue using :

conda install nb_conda
conda install ipykernel
python -m ipykernel install --user --name mykernel

Sorry for my dumb issue and thank you to those who already commented my quesiton!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文