virtualenv command not found
Introduction
When you run more command in linux terminal / console, you get the following error message
virtualenv: command not found
or when using sudo you get the following error message
sudo: virtualenv: command not found
Solutions to virtualenv: command not found
How To Fix virtualenv: command not found in Ubuntu / Debian / Kali Linux / Raspbian
In Ubuntu virtualenv is provided by python3-virtualenv package.
python3-virtualenv is:
virtualenv is a tool to create isolated Python environments, each invokable with its own Python executable. Each instance can have different sets of modules, installable via pip. Virtual Python instances can also be created without root access.
Since Python 3.3, a subset of it has been integrated into the standard library under the venv module (python3-venv in Debian). The venv module does not offer all features of this library, to name just a few more prominent ones:
- is slower (by not having the app-data seed method),
- is not as extendable,
- cannot create virtual environments for arbitrarily installed python versions (and automatically discover these),
- does not have as rich programmatic API (describe virtual environments without creating them).
This is the Python 3 version of the library. It includes the command line script.
To fix this problem, we can install more using the command below.
sudo apt-get -y install python3-virtualenv
This command might take some time to finish depending on your machine internet connection.
You can also use apt command to install python3-virtualenv.
sudo apt -y install python3-virtualenv
Or if you have aptitude installed you can use the following command.
sudo aptitude install python3-virtualenv
Summary
In this tutorial we learn how to fix virtualenv command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.