Project

General

Profile

Support #874

Updated by Daniel Curtis about 8 years ago

This is a guide for setting up a simple development environment for python with virtualenv on FreeBSD. 

 h2. Prepare the Environment 

 * Make sure the system is up to date: 
 <pre> 
 pkg update && pkg upgrade 
 </pre> 

 h2. Install Python 

 * Install python and a few dependencies: 
 <pre> 
 pkg install bash python py27-{pip,pkgconfig,setuptools27,virtualenv} py27-{pip,setuptools27,virtualenv} 
 </pre> 

 * Create a non-privileged user to develop with: 
 <pre> 
 pw group add pydev 
 pw user add pydev -m -g pydev -s /usr/local/bin/bash -c "Python Dev" 
 </pre> 

 h2. Create Virtualenv 

 * Switch to the python dev user: 
 <pre> 
 su - pydev 
 </pre> 

 * Create a new virtualenv called new_app: 
 <pre> 
 virtualenv new_app 
 </pre> 

 * Activate the new_app virtualenv to begin using it: 
 <pre> 
 source ./new_app/bin/activate 
 </pre> 

 * Install or develop the new_app: 
 <pre> 
 pip install new_app 
 </pre> 

 * When done working in the virtual environment for the moment, deactivate it: 
 <pre> 
 deactivate 
 </pre> 

 h2. Resources 

 * http://docs.python-guide.org/en/latest/dev/virtualenvs/

Back