8

Since I do not use them at this time I tried to uninstall virtualenv and virtualenvwrapper via the Ubuntu Software Center. Now whenever I open a console I get the following error message:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named virtualenvwrapper.hook_loader
virtualenvwrapper.sh: There was a problem running the initialization hooks. If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenv has been installed for VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is set properly.

Also the directory ~/.virtualenvs/ is still present.

How can I bring my system back to a clean and functional state as before the installation of virtualenv and virtualenvwrapper?

Updates

As suggested I checked the following files for occurrences of virtualenv each with a negative result:

~/.bashrc
~/.profile
/etc/profile
/etc/profile.d/*
/etc/environment

2 Answers2

6

I got the same issue, but eventually found out where the problematic file was. It's

/etc/bash_completion.d/virtualenvwrapper

Delete it and you won't see the error message again.

PS: Here's how I found out where the file was:

grep -lir "virtualenvwrapper" /etc/

TomTasche
  • 404
1

You've probably followed this step from the documentation:

You will want to add the command to source /usr/local/bin/virtualenvwrapper.sh to your shell startup file, changing the path to virtualenvwrapper.sh depending on where it was installed by pip.

Just installing the virtualenvwrapper won't include anything in your shell startup and you would not have got the error in your question on opening a new console.

I cannot guess where exactly you've modified your shell configuration, but if you use Bash, then you've probably put it in ~/.bashrc or ~/.profile:

export WORKON_HOME=~/Envs
source /usr/local/bin/virtualenvwrapper.sh

Just remove those lines and try to create a new terminal window.

gertvdijk
  • 69,427