issues with python virtual environment
<p><br>
I am facing following 2 issues:<br></p>

<ol>
<li>python command is not using the virtualenvwrapper python.<br>
After activating my virtual environment if I type python then the code still uses the native python libraries. I can easily install libraries etc with pip to my virtual environment but I cannot run any command using python.<br>
e.g. if I execute <br><b>$ ./manage.py runserver</b><br>then it is fine and I can run a django server <br>
but if I try <br><b>$ python manage.py runserver</b><br>
or even just<br>
<b>$ python</b><br>
then it uses the native python libraries and that should not happen<br></li>
</ol>

<p>This is while using iterm or terminal in osx. I have never faced this problem in any linux based os</p>

<ol start="2">
<li>While using any os (linux based or osx), the <b>workon</b> command doesn't work inside any shell script, while it works normally in a terminal<br></li>
</ol>

<p>os: osx</p>

<p>You could try install virtualenv and virtualenvwrapper from pip3.</p>

<pre><code>pip3 install virtualenv virtualenvwrapper
</code></pre>

<p>And then find where virtualenvwrapper.sh file is:</p>

<pre><code>find / -name 'virualenvwrapper.sh'
</code></pre>

<p>I have mine in <code>/usr/local/bin/virtualenvwrapper.sh</code>. But it seems that you have it in some different directory. So you must change below config to fit your needs.
And then in your <code>.bashrc</code> or <code>.zshrc</code>:</p>

<pre><code># Python3 virtualenv/venvwrapper
export WORKON_HOME=~/.virtualenvs
VIRTUALENVWRAPPER_PYTHON='/usr/bin/python3' # This needs to be placed before the virtualenvwrapper command
export PROJECT_HOME=$HOME/Projects
source /usr/local/bin/virtualenvwrapper.sh # your path to virtualenvwrapper.sh
</code></pre>

<p>Let me know if it works :)</p>

python linux django osx