Error "virtualenv : command not found" but install location is in PYTHONPATH
<p>This has been driving me crazy for the past 2 days.
I installed virtualenv on my Macbook using <code>pip install virtualenv</code>.
But when I try to create a new virtualenv using <code>virtualenv venv</code>, I get the error saying "virtualenv : command not found".</p>

<p>I used <code>pip show virtualenv</code> and the location of the installation is "Location: /usr/local/lib/python2.7/site-packages" but I can't figure out where the executable is. I tried dozens other similar looking posts but those solutions do not work for me.</p>

<p>Any ideas what might be going wrong here?</p>

<p>As mentioned in the comments, you've got the virtualenv module installed properly in the expected environment since <code>python -m venv</code> allows you to create virtualenv's. </p>

<p>The fact that <code>virtualenv</code> is not a recognized command is a result of the <code>virtualenv.py</code> not being in your system PATH and/or not being executable. The root cause could be outdated distutils or setuptools.</p>

<p>You should attempt to locate the <code>virtualenv.py</code> file, ensure it is executable (<code>chmod +x</code>) and that its location is in your system PATH. On my system, <code>virtualenv.py</code> is in the <code>../Pythonx.x/Scripts</code> folder, but this may be different for you.</p>

python python-2.7 pip