Ahmed Istehad
Ahmed Istehad

Reputation: 1

Why I cannot import arch module in python despite it showing in my pip list?

pip list shows:

Package                Version
---------------------- ---------
absl-py                0.9.0
arch                   4.15
async-generator        1.10
attrs                  19.3.0
auquan-toolbox         2.1.92
backcall               0.1.0
.....

But when I use from arch import arch_model, I get the following error:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-52-f7e7e7ccf968> in <module>
----> 1 from arch import arch_model

ModuleNotFoundError: No module named 'arch'

can anyone help?

Upvotes: 0

Views: 7623

Answers (1)

akBeater
akBeater

Reputation: 106

Are you using Python3 or Python2? You have to use Python3 with pip3 according to the github documentation https://github.com/bashtage/arch: arch is Python 3 only. Version 4.8 is the final version that supported Python 2.7.

With Python3 and pip3 I get it to work:

arch 4.15 ($ pip3 list | grep arch)
This works:

import arch

But i think you want that command:

from arch import arch_model

Both are successfull.

(Python 3.8.2 with pip3)

Upvotes: 1

Related Questions