在google colab中导入“pyearth”

dwthyt8l  于 2021-07-13  发布在  Java
关注(0)|答案(0)|浏览(355)

我需要加载一个名为 pyearth 在googlecolab上。这就是我想做的:


# Import model from library

from pyearth import Earth

# Initialize model

reg = Earth()

但是,默认情况下googlecolab没有这个库。当我尝试时,会得到以下错误提示 import pyearth :
modulenotfounderror:没有名为“pyearth”的模块
因此,我尝试使用 !pip ,但是,如下所示,它也不起作用。


# Instal `pyearth`

!pip install pyearth # Runs smoothly

# Import Earth

from pyearth import Earth

> ImportError: cannot import name 'Earth' from 'pyearth' (/usr/local/lib/python3.7/dist-packages/pyearth/__init__.py)

奇怪的是, import pyearth 确实有效。
这篇文章涉及一个非常类似的问题,至今仍未解决。唯一可用的答案对我不起作用。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题