sintel-dev / Orion

A machine learning library for detecting anomalies in signals.
https://sintel.dev/Orion/
MIT License
1.03k stars 159 forks source link

Colab - ImportError #182

Open dyuliu opened 3 years ago

dyuliu commented 3 years ago

I launched colab notebooks and tried to run cells one by one.

But I encountered the ImportError. (1) image

(2) image

sarahmish commented 3 years ago

Thanks @dyuliu for pointing this issue.

The problem here is that you need to restart runtime after finishing the installation and run the block again, because you are uninstalling default pandas and urllib versions in colab.

# install dependencies then restart kernel and run again
! pip install orion-ml
! pip install 'urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1'

! git clone https://github.com/signals-dev/Orion.git
! mv Orion/notebooks/tulog/* .

The second part of cloning the repo and copying files is causing the issue for you (because it has not been run). I am wondering if you have an idea of a better installation mechanism than basic pip install and git clone commands. Ideally, I wish to have a persistent environment that colab always runs from but I don't think this is possible.

It's a similar issue pointed to in #153.

sarahmish commented 3 years ago

Main issue When you run !pip install orion-ml cell, orion installs some versions of libraries, for example pandas, that are counter to the default version in google colab. Thus, colab sends a subtle message of asking the user to restart runtime. If this task is ignored, the user will run into an error in the rest of the notebooks (as demonstrated by @dyuliu).

Discussion of possible solutions

Considerations to keep in mind

Improvements to the current setup