Forums

virtualenvwrapper.sh: There was a problem running the initialization hooks.

I am trying to set up a virtual env and install from a requirements.txt file

I hadnt used my account in awhile and I think changing system images may have caused this. I think I moved from fish&chips to earlgray or whatever latest is.

Currently these are the errors im seeing.

alexlightship@green-euconsole2:~$ virtualenv 
bash: virtualenv: command not found

alexlightship@green-euconsole2:~$ mkvirtualenv
ERROR: virtualenvwrapper could not find virtualenv in your path

alexlightship@green-euconsole2:~$ pip
bash: pip: command not found

.bashrc

1 
2 
3 VIRTUALENVWRAPPER_PYTHON=$(which python3)                                                                                                                                                                                  
4 
5 source virtualenvwrapper.sh

If i remove line 3 from my .bashrc and start a new bash terminal I see this

/usr/local/bin/virtualenvwrapper.sh: line 230: : command not found
virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON= and that PATH is
set properly.
bash: : command not found
virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON= and that PATH is
set properly.
alexlightship@green-euconsole2:~$

You have permission to access my files :)

It looks like you've done something to your .bashrc that is causing it to not add things to the path or to initialise virtualenvwrapper. Just delete the file and then start a new bash console to have the system re-create it.

Thank you Glenn, this solved the problem :)