无法从Pycaret解决导入错误

发布于 2025-01-25 14:31:14 字数 267 浏览 3 评论 0原文

我试图通过在Anaconda(Python 3.8)中创建环境来安装Pycaret。一切都很好,除非我尝试从pycaret.classification import *我显示出一个错误,尽管我已经安装了所有依赖项:

Importerror:缺少可选依赖性'jinja2'。 DataFrame.Style需要Jinja2。使用PIP或CONDA安装Jinja2。 我尝试刷新内核并重新安装Jinja2,但错误仍然存​​在。我可以知道如何克服它吗?

I am trying to install pycaret by creating an environment in anaconda (python 3.8). Everything is fine except when i tried to from pycaret.classification import * i shows an error despite the fact that i have installed all dependencies:

ImportError: Missing optional dependency 'Jinja2'. DataFrame.style requires jinja2. Use pip or conda to install Jinja2.
I tried refreshing the kernel and reinstalling Jinja2 but the error remains. May i know how could i overcome it?

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

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

发布评论

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

评论(3

病女 2025-02-01 14:31:14

我在COLAB中也有同样的问题,我通过强制markupsafe版本进行修复:

pip install markupsafe==2.0.1

此后,下一个导入像以前一样工作

import jinja2
pycaret.classification import *

I had same issue in colab, I fixed it by forcing the markupsafe version:

pip install markupsafe==2.0.1

After this, the next imports worked as before

import jinja2
pycaret.classification import *
回首观望 2025-02-01 14:31:14

我也有同样的问题,并通过:

!pip install pycaret==2.3.10 markupsafe==2.0.1 pyyaml==5.4.1 -qq

I have same issue and fixed it by:

!pip install pycaret==2.3.10 markupsafe==2.0.1 pyyaml==5.4.1 -qq
一张白纸 2025-02-01 14:31:14

谢谢。
因此,当我运行上述语句时,它给了我一些兼容性错误。
所以我执行了以下语句

!pip uninstall imgaug && pip uninstall albumentations && pip install git+https://github.com/aleju/imgaug.git

Thank you.
So when I ran the above statement it gave me some compatibility error.
So I executed the following statement

!pip uninstall imgaug && pip uninstall albumentations && pip install git+https://github.com/aleju/imgaug.git
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文