Virtualenv Command Not Found
If you installed it with
pip install virtualenv
You need to run
sudo /usr/bin/easy_install virtualenv
which puts it in /usr/local/bin/
.
The above directory by default should be in your PATH
; otherwise, edit your .zshrc
(or .bashrc
) accordingly.
I faced the same issue and this is how I solved it:
- The issue occurred to me because I installed virtualenv via pip as a regular user (not root). pip installed the packages into the directory
~/.local/lib/pythonX.X/site-packages
- When I ran pip as root or with admin privileges (sudo), it installed packages in
/usr/lib/pythonX.X/dist-packages
. This path might be different for you. - virtualenv command gets recognized only in the second scenario
- So, to solve the issue, do
pip uninstall virtualenv
and then reinstall it withsudo pip install virtualenv
(or install as root)
The simplest answer. Just:
pip uninstall virtualenv
and then:
pip install virtualenv
Or you maybe installed virtualenv with sudo
, in that case:
pip install --user virtualenv