How-to articles, tricks, and solutions about VIRTUALENV

How can I install packages using pip according to the requirements.txt file from a local directory?

To install packages using pip from a local directory, you can use the -r option to specify the path to the requirements.txt file.

How do I update/upgrade pip itself from inside my virtual environment?

To update pip itself from inside your virtual environment, you can use the following command:

How to activate virtualenv in Linux?

To activate a virtual environment in Linux, you can use the source command and the path to the activate script that is located in the virtual environment's bin directory.

How to leave/exit/deactivate a Python virtualenv

To leave a Python virtual environment, you can use the deactivate command.

Use different Python version with virtualenv

To use a different Python version with virtualenv, follow these steps:

Using Python 3 in virtualenv

Here is an example of how you can use Python 3 in a virtual environment using the virtualenv package:

What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc?

There are many different tools that you can use to create isolated Python environments, each with their own benefits and drawbacks.

What is the easiest way to remove all packages installed by pip?

The easiest way to remove all packages installed by pip is to use the command pip freeze to get a list of all installed packages, and then pipe that list to pip uninstall -y, like this: