Python 3 Virtualenv Ubuntu Usage Guide

December 9, 2017 | By the+gnu+linux+evangelist.

Python 3 Virtualenv Ubuntu Usage

Hi! The Tutorial shows you Step-by-Step How to Getting-Started with Python 3.X Virtualenv on Ubuntu 16.04 Xenial LTS GNU/Linux.

And a Python 3 Virtualenv on Ubuntu 16.04 Setup make use of the Python 3 venv Tool to Make Virtual Environments.

Finally, each venv Virtual Environment has its own Python binary and can have its own independent set of installed Python packages in its site directories.

Python 3 Virtualenv Ubuntu Usage Guide - Featured
  1. Open a Terminal Shell emulator window
    Ctrl+Alt+t on Desktop
    (Press “Enter” to Execute Commands)

    Python 3 Virtualenv Ubuntu Usage Guide - Open Terminal Shell Emulator
  2. Install Virtualenv Python 3 on Ubuntu

    Virtualenv Python 3 Install Guide
  3. To Make a Python 3 Virtual Environmnet.

    python3 -m venv test ~/Envs/test
  4. Then to Activate Virtual Environment.

    source ~/Envs/test/bin/activate
  5. To List All the Existing Virtual Environments.

    ls $WORKON_HOME
  6. To Switch the Virtual Environmnet.

    python3 -m venv test ~/Envs/essai
    source ~/Envs/essai/bin/activate

    Show the Working Virtual Env:

    echo $VIRTUAL_ENV
  7. To Install Software into the Virtual Environmnet.

    For Example:

    pip install django
  8. To List All the Virtual Environmnet Packages.

    lssitepackages
  9. To Automatically Run a Command after Environment Creation.

    echo '[bash-command]' > $WORKON_HOME/postactivate

    For Instance to Automatically Change to the New Env Directory:

    echo 'cd $VIRTUAL_ENV' > $WORKON_HOME/postactivate
  10. To Automatically Installing Commonly Used Tools.

    echo 'pip install [myGoodTool]' > $WORKON_HOME/postmkvirtualenv

    For Example:

    echo 'pip install sphinx' > $WORKON_HOME/postmkvirtualenv
  11. Getting-Started with Python Selenium Testing Browser Environment:

    Quick-Start with Selenium Python Client

QuickChic Theme • Powered by WordPress