Python3 Virtual Environment for Ansible - CloudCommandos/JohnChan GitHub Wiki

Assumptions

  • Ubuntu 18.04 VM

Setup Python3 Virtual Environment

Install pip3 venv

apt-get update
apt-get install python3-pip
pip3 install venv

Create virtual environment

python3 -m venv /opt/virtualenv

Activate virtual environment

source /opt/virtualenv/bin/activate

Install Ansible inside virtual environment

pip3 install ansible