pythonscikit-learnrocketsktime

ModuleNotFoundError: No module named 'sktime.transformers'


I tried importing

from sktime.transformers.series_as_features.rocket import Rocket

When I run this, I encounter this error ---

File "C:\Users\Success\AppData\Local\Temp/ipykernel_8440/2082396040.py", line 1, in <module>
runfile('C:/Users/Success/Desktop/untitled8.py', wdir='C:/Users/Success/Desktop')

File "C:\Users\Success\anaconda3\lib\site-packages\debugpy\_vendored\pydevd\_pydev_bundle\pydev_umd.py", line 167, in runfile
execfile(filename, namespace)
File "C:\Users\Success\anaconda3\lib\site-packages\debugpy\_vendored\pydevd\_pydev_imps\_pydev_execfile.py", line 25, in execfile
exec(compile(contents + "\n", file, 'exec'), glob, loc)
File "C:/Users/Success/Desktop/untitled8.py", line 11, in <module>
from sktime.transformers.series_as_features.rocket import Rocket

ModuleNotFoundError: No module named 'sktime.transformers

Solution

  • The package was not installed.

    There are various ways one can install sktime (See here official documentation). Will leave below two options:

    1. Using PyPI

    2. Using conda


    Option 1: Using PyPI

    For that, access the prompt for the environment that you are working on, and run

    pip install sktime
    

    To install sktime with maximum dependencies, including soft dependencies, install with the all_extras modifier:

    pip install sktime[all_extras]
    

    Option 2: Using conda

    For that, access the prompt for the environment that you are working on, and run

    conda install -c conda-forge sktime
    

    To install sktime with maximum dependencies, including soft dependencies, install with the all-extras recipe:

    conda install -c conda-forge sktime-all-extras
    

    By the time I am writing this, this last one (Source):

    does not include dependencies catch-22, pmdarima, and tbats. As these packages are not available on conda-forge, they must be installed via pip if desired. Contributions to remedy this situation are appreciated.


    Notes: