I am using python-fabric
to setup my server, which configures the server programatically.
So, I installed virtualenvwrapper
as :
sudo apt-get install virtualenvwrapper
That installed - Virtualenvwrapper and adds its initialization scripts to shell startup.
Generally we restart the shell and it gets initialized, but in my case I can-not restart the shell over fabric
.
Since it was installed with apt-get
I was not able to find the initialization scripts entry in ~/.bashrc
or ~/.bash_profile
or /etc/bash.bashrc
So, where did apt-get
added call to the initialization scripts ?
How to refresh the shell
without restarting the shell ?
virtualenvwrapper is a set of shell functions defined in Bourne shell compatible syntax. Its automated tests run under these shells on OS X and Linux: ... David Marble has ported virtualenvwrapper to Windows batch scripts, which can be run under Microsoft Windows Command Prompt. This is also a separately distributed re-implementation.
If it's 42, the environment was not reset. There is also exec -c bash -l or exec env -i bash -l, but these are broken, somehow the $HOME variable is not set after this. Thanks, that's useful. See my edit, which does not assume bash and uses -l to ensure a login shell and uses exec so there are no nested shells. best answer!
The variable VIRTUALENVWRAPPER_HOOK_DIR tells virtualenvwrapper where the user-defined hooks should be placed. The default is $WORKON_HOME. The variable VIRTUALENVWRAPPER_LOG_FILE tells virtualenvwrapper where the logs for the hook loader should be written.
You have to replace the running application/shell with a new instance. E.g. if you are using bash as your preferred shell type the following line in your command line ( $ is the placeholder for the beginning of your command line): The running application/shell is replaced by new instance of bash like starting from scratch.
Solved the problem :
source /etc/bash_completion.d/virtualenvwrapper
This is where it was storing all its magic which gets included to .bashrc
automatically.
Try hash -r
. It is a bash builtin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With