Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My virtualenv does not work after installing zsh

I installed zsh, oh-my-zsh. And made zsh as a default shell. But when I try to activate my virtualenv with

source bin/activate

There is no any effect. I mean no errors and also I am not in my virtual environment. Then I entered my earlier bash shell and tried activating but it did not also help?

updated
when I create new virtualenv it works well. Then how can I activate older ones?

like image 246
Maksat Yalkabov Avatar asked Apr 01 '15 15:04

Maksat Yalkabov


1 Answers

By default, the zsh virtualenv plugin hides the virtualenv name.

vim ~/.oh-my-zsh/plugins/virtualenv/virtualenv.plugin.zsh

You'll see these in the file

# disables prompt mangling in virtual_env/bin/activate
export VIRTUAL_ENV_DISABLE_PROMPT=1

Hash out export VIRTUAL_ENV_DISBALE_PROMPT=1 and reload ZSH.

You'll see

New python executable in /Users/edd/.virtualenvs/test2/bin/python2.7
Also creating executable in /Users/edd/.virtualenvs/test2/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating
/Users/edd/.virtualenvs/test2/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/edd/.virtualenvs/test2/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/edd/.virtualenvs/test2/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/edd/.virtualenvs/test2/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/edd/.virtualenvs/test2/bin/get_env_details

Try virtualenv to test.

You can get more information from here.

like image 90
castin Avatar answered Sep 20 '22 13:09

castin