How-to Getting-Started with Python 3.X Virtual Environments on Ubuntu 14.04 Trusty LTS Linux Easy Guide

December 6th, 2014 by thelinuxevangelist

Python 3 Virtualenv/Virtualenvwrapper Ubuntu Quick-Start



The Linux Tutorial Shows You Step-by-Step How-to Install and Getting-Started with Python 3.x/2.x Virtualenv and Virtualenvwrapper for Ubuntu 14.04 Trusty Tahr LTS i386/amd64 Linux.

A Virtualenv Environment, put simply, is an isolated working copy of Python which allows you to work on a specific project without worry of affecting other projects.

The Virtualenvwrapper include wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies.

Getting-Started Virtualenv/Virtualenvwrapper Python 3 on Ubuntu 14.04 Trusty LTS - Featured
  1. Open a Command Line Shell Session
    Ctr+Alt+t on Desktop
    (Press “Enter” to Execute Commands)

    Django Python 3 Quick-Start on Ubuntu 14.04 Trusty LTS - Open Terminal
  2. How-to Install Python 3 PIP for Ubuntu Linux:

    Python 3 PIP Quick-Start Guide
  3. Installing Virtualenv+Virtualenvwrapper Python 3

    sudo su -c "pip3 install virtualenvwrapper"
  4. Initial Virtualenv SetUp

    nano $HOME/.bashrc

    Append:

    export WORKON_HOME=~/Envs

    Ctrl+x to Save & Exit from ‘nano’ Editor :)

    bash
    source /usr/local/bin/virtualenvwrapper.sh

    Then You Dispose of 2 Virtualenv Versions: ‘virtualenv’ for Python 3.x and ‘virtualenv-2.x’ for Python 2.x
    To Show Up:

    ls -l /usr/local/bin | grep virtualenv
  5. How-to Getting-Started with Python Selenium Browser Testing:
    Setup Python Selenium Wedriver.

  6. To Make a Python Virtual Environmnet

    mkvirtualenv test
  7. To List All the Existing Virtual Environments

    ls $WORKON_HOME
  8. To Switch the Virtual Environmnet

    mkvirtualenv essai
    workon test

    Show the Working Virtual Env:

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

    For Example:

    pip3 install django
  10. To List All the Virtual Environmnet Packages

    lssitepackages
  11. 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
  12. To Automatically Installing Commonly Used Tools

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

    For Example:

    echo 'pip3 install sphinx' >> $WORKON_HOME/postmkvirtualenv
Share on Tumblr

Tags: , , , , , , , , , , , , , , , , , , , , ,


Comments are disabled