QA/Execution/Web Testing/Automation/Virtual Environments: Difference between revisions
< QA | Execution | Web Testing | Automation
Jump to navigation
Jump to search
Line 19: | Line 19: | ||
<i>Exception: use 32-bit version of the setuptools even if your operating system is 64-bit otherwise it fails to find the Python installation.</i> | <i>Exception: use 32-bit version of the setuptools even if your operating system is 64-bit otherwise it fails to find the Python installation.</i> | ||
<ol> | <ol> | ||
<li>Install the 32-bit version of | <li>Install the 32-bit version of SetupTools using the provided <b>.exe installer</b>:</li> | ||
<li>Download the last pip version | http://pypi.python.org/pypi/setuptools#files | ||
<li>In your <b><i>cmd prompt</i></b>, go to the uncompressed pip directory and run < | <li>Download the last pip version and uncompress it:</li> | ||
<li>Add | http://pypi.python.org/pypi/pip#downloads | ||
<li>In your <b><i>cmd prompt</i></b>, go to the uncompressed pip directory and run:</li> | |||
python setup.py install | |||
<li>Add the Scripts directory to your System Variables path:</li> | |||
C:\Python26\Scripts | |||
<li>Now you can use the command pip install package on Win.</li> | <li>Now you can use the command pip install package on Win.</li> | ||
</ol> | </ol> |
Revision as of 21:52, 26 October 2012
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 virtualenvwrapper documentation.
Install virtualenvwrapper
- Install virtualenvwrapper: sudo pip install virtualenvwrapper
- Add the following to your ~/.bash_profile: export WORKON_HOME=$HOME/.virtualenvs source /usr/local/bin/virtualenvwrapper.sh
Create a virtual environment for WebQA
mkvirtualenv webqa
Switch to the WebQA virtual environment
workon webqa
Installation on Windows
Exception: use 32-bit version of the setuptools even if your operating system is 64-bit otherwise it fails to find the Python installation.
- Install the 32-bit version of SetupTools using the provided .exe installer: http://pypi.python.org/pypi/setuptools#files
- Download the last pip version and uncompress it: http://pypi.python.org/pypi/pip#downloads
- In your cmd prompt, go to the uncompressed pip directory and run: python setup.py install
- Add the Scripts directory to your System Variables path: C:\Python26\Scripts
- Now you can use the command pip install package on Win.
Virtualenvwrapper Installation and Usage
- From the cmd prompt install pip: pip install virtualenvwrapper-win
- Set your environment variable: WORKON_HOME = C:\Python27\Scripts:
- You can now create virtualenvs: mkvirtualenv <name of the environment>