Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question
    
Well, you have followed some additional user-specific steps in the installation of virtualenvwrapper. This is outside the scope of the Ubuntu Software Centre. Please include the steps you have followed (perhaps the official docs?). Then we can provide instructions how to revert these steps. –  gertvdijk Jul 9 '13 at 12:15
    
I can not remember to have done so. Can this result from an installation by pip? Unfortunately I do not know whether I used pip or the Software Center to install. How can I find out? –  hielsnoppe Jul 9 '13 at 12:20
    
I found it in the history so I am pretty sure I used Software Center instead of pip. Anyhow I do not know of any changes I made especially not in reference to the docs. –  hielsnoppe Jul 9 '13 at 12:37
add comment

2 Answers 2

up vote 5 down vote accepted

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/

share|improve this answer
add comment

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.

share|improve this answer
    
Thanks for taking the time to help! Unfortunately neither of the two files contains the lines you mention. Is there another place where they might be written? I am pretty sure that I never put them anywhere by hand. –  hielsnoppe Jul 9 '13 at 13:56
    
Try /etc/profile, files in /etc/profile.d/ (I think one of those could be it) and /etc/environment. –  gertvdijk Jul 9 '13 at 14:21
    
I checked all of these (see updated question) and there is nothing about virtualenv in there. :S –  hielsnoppe Jul 9 '13 at 18:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.