QA/Execution/Web Testing/Automation/Virtual Environments: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Virtual environments are isolated Python environments. They allow freedom to install specific versions of dependencies without affecting the global site-packages. They also make it easy to throw away a 'broken' environment and start again. If you need further information regarding virtual environments, please see the [http://www.doughellmann.com/docs/virtualenvwrapper/index.html virtualenvwrapper documentation].
Virtual environments are isolated Python environments. They allow freedom to install specific versions of dependencies without affecting the global site-packages. They also make it easy to throw away a broken environment and start again. We recommend using '''virtualenvwrapper''' for managing your virtual environments. See the documentation for a guide to [http://virtualenvwrapper.readthedocs.org/en/latest/install.html installation] and the [http://virtualenvwrapper.readthedocs.org/en/latest/command_ref.html command reference]. There's also a useful introduction to virtualenv and virtualenvwrapper in [http://www.silverwareconsulting.com/index.cfm/2012/7/24/Getting-Started-with-virtualenv-and-virtualenvwrapper-in-Python this blog post].
 
== Install virtualenvwrapper ==
<ol>
  <li>Install virtualenvwrapper:</li>
    sudo pip install virtualenvwrapper
  <li>Add the following to your ~/.bash_profile:</li>
    export WORKON_HOME=$HOME/.virtualenvs
    source /usr/local/bin/virtualenvwrapper.sh
</ol>
 
== Create a virtual environment for WebQA ==
    mkvirtualenv webqa
 
== Switch to the WebQA virtual environment ==
    workon webqa
 
== Installation on Windows ==

Latest revision as of 14:32, 6 November 2015

Virtual environments are isolated Python environments. They allow freedom to install specific versions of dependencies without affecting the global site-packages. They also make it easy to throw away a broken environment and start again. We recommend using virtualenvwrapper for managing your virtual environments. See the documentation for a guide to installation and the command reference. There's also a useful introduction to virtualenv and virtualenvwrapper in this blog post.