python Error

pip Error: ImportError: No module named xx

In the Python programming language, this article introduces the cause, how to handle, and resolve the ImportError: No module named xx error when a library is installed with pip. python2 should be connected to pip, so you should be able to install libraries with pip. sudo pip install plyvel...

Shou Arisaka
1 min read
Oct 11, 2025

In the Python programming language, this article introduces the cause, how to handle, and resolve the ImportError: No module named xx error when a library is installed with pip.

python2 should be connected to pip, so you should be able to install libraries with pip.

sudo pip install plyvel

$ python -c 'import plyvel'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named plyvel

What…

Verification.

$ pip --version
pip 19.0.3 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)
$ pip3 --version
pip 19.0.3 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)
$ pip2 --version
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
$ type pip
pip     pip2    pip3    pip3.6
$ type pip

In my previous environment at least, it was connected as pip … python2, pip3 … python3, and I didn’t even know pip2 existed. In this case, pip and pip3 are associated with python3, and pip2 should have been used to install python2 libraries.

sudo pip2 install --upgrade pip
sudo pip2 install plyvel

$ python -c 'import plyvel'
$
# => no error

Share this article

Shou Arisaka Oct 11, 2025

🔗 Copy Links