Python could not import the module virtualenvwrapper.hook_loader?

cw12345 picture cw12345 · Jul 7, 2017 · Viewed 7k times · Source

If Python could not import the module virtualenvwrapper.hook_loader, and I get this message

check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 and that PATH is
set properly.

How do I start to set it up in Debian 9?

Answer

thisshri picture thisshri · Sep 20, 2019

Installing virtualenv by both, pip and pip3 doesn't make any sense because installing it by any one shows virutalenvwrapper in both, pip list and pip3 list.

The right way is to copy the following code in your ~/.bashrc.

VIRTUALENVWRAPPER_PYTHON=$(which python3)

NOTE: Use the python version you want to use, in my case it's python3.