Getting ModuleNotFoundError: No module named ‘kats’ even after successfully installing Kats

huangapple go评论98阅读模式
英文:

Getting ModuleNotFoundError: No module named 'kats' even after successfully installing Kats

问题

I am using google colab and trying to use kats library. Eventhough I successfully installed the kats, I get an error saying ModuleNotFoundError: No module named 'kats' when I import TimeSeriesData from kats.
Has anyone got a solution for resolve this error?

To install kats in colab, I first

!pip install kats

This runs successfully.
Then, I run below to import all necessary packages,

import numpy as np
import pandas as pd
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
import sys
sys.path.append("../")

import warnings
warnings.filterwarnings('ignore')

from kats.consts import TimeSeriesData

However, running above throws a following error

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-44-cec780e07a9e> in <cell line: 11>()
      9 warnings.filterwarnings('ignore')
     10 
--> 11 from kats.consts import TimeSeriesData

ModuleNotFoundError: No module named 'kats'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
英文:

I am using google colab and trying to use kats library. Eventhough I successfully installed the kats, I get an error saying ModuleNotFoundError: No module named 'kats' when I import TimeSeriesData from kats.
Has anyone got a solution for resolve this error?

To install kats in colab, I first

!pip install kats

This runs successfully.
Then, I run below to import all necessary packages,

import numpy as np
import pandas as pd
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
import sys
sys.path.append("../")

import warnings
warnings.filterwarnings('ignore')

from kats.consts import TimeSeriesData

However, running above throws a following error

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-44-cec780e07a9e> in <cell line: 11>()
      9 warnings.filterwarnings('ignore')
     10 
---> 11 from kats.consts import TimeSeriesData

ModuleNotFoundError: No module named 'kats'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

答案1

得分: 0

你尝试过重置运行时吗?

如果你正在使用Google Colab,这应该不是与Python版本有关的问题。

你可以尝试使用以下命令安装Kats的最小版本:“MINIMAL_KATS=1 pip install kats”来查看是否有所不同。

除此之外,假设你还没有尝试过,你可以卸载然后重新安装Kats库。

还可以考虑下载类似Anaconda的东西,然后在Spyder或其他环境中尝试。

英文:

Have you tried resetting the runtime?

If you are using google colab it should not be an issue with the python version.

You could try installing the minimal version of Kats with: "MINIMAL_KATS=1 pip install kats" to see if that makes a difference.

Other than that, assuming you have not already tried it, you could uninstall and then reinstall the kats library.

Also might be worth downloading something like anaconda and trying it out in spyder or something.

huangapple
  • 本文由 发表于 2023年6月29日 17:59:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76579993.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定