$ sudo aptitude install python-virtualenv
for virtualenv
support, including pip.$ sudo aptitude install python-dev
if you want support for C
modules.
We recommend one virtual environment for each app, and putting virtual
environment inside the project directory. Note that with a default Ubuntu
configuration, information on the user and working directory
(user@path
) will display between to the left of the prompt
($
).
$ mkdir mydjangoapp
$ cd mydjangoapp
$ virtualenv --no-site-packages mydjangoappvenv
$ source mydjangoappvenv/bin/activate
(mydjangoappvenv)$ pip install django
(mydjangoappvenv)$ cd ../
(mydjangoappvenv)$ django-admin.py mydjangoapp mydjangoapp
By keeping each Django project in its own virtual environment, you can easily create a text file containing the Python package requirements for it. Here's how: from within the virtual environment for which you want a requirements file, run:
(mydjangoappvenv)$ pip freeze > requirements.txt
You can use this file to install all the packages you need in a new virtual environment:
(mynewdjangoappvenv)$ pip install -r requirements.txt