Search code examples
pythonimporterror

package installed but cannot import it


I have successfully installed the bitarray package, because I can find it after the command: pip list.

But when I try to import it I get :

>>> from bitarray import bitarray

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    from bitarray import bitarray
ModuleNotFoundError: No module named 'bitarray'

What can I try to solve it ?

I'm using Ubuntu 18.04.5 .


Solution

  • You can install package as python3 -m pip install bitarray. May be when you did pip install bitarray, it install your package for python2.