Virtual Environment(virtualenv) make easy to manage various environment for development.
It can create environment for each different version of python.
Install virtualenv.
$ sudo pip install virtualenv
Install virtualenvwrapper for easy control.
$ pip install virtualenvwrapper
Make virtualenv home directory.
$ mkdir ~/.virtualenvs
Setup for shell.
Write directory for work in ~/.bashrcexport WORKON_HOME=$HOME/.virtualenvsFor execute virtualenvwrapper. (in ~/.bashrc)
export PROJECT_HOME=$HOME/[YOUR_WORKSPACE]
source /usr/local/bin/virtualenvwrapper.shApply.
$ source ~/.bashrcCheck.
$ echo $WORKON_HOME
Make virtualenv for python3. (Assume python3.4 was installed.)
$ mkvirtualenv --python=/usr/bin/python3 [ENV_NAME]It will make virtualenv in your WORKON_HOME directory.
Check.
$ echo $WORKON_HOME
$ ls $WORKON_HOME
$ workonCheck your python version.
$ python --version
Install django on your virtual env (1.7)
Go into your virtual env.$ workon [ENV_NAME]
Install django.
$ pip install django
Basic command for management.
Check your virtualenv projects.
workonGo into virtualenv.
workon [ENV_NAME]Deactivate from virtualenv.
deactivate
4 comments:
Nice Article, secure Web Hosting Deals please visit Go4hosting, you can get here all your Web Hosting Solutions like Dedicated server, VPS Hosting, Colocation Hosting, hybrid Cloud, Cloud Cdn and Cloud Storage.
I am working at Rackbank & have created a Python 3.4 virtualenv using:
sudo virtualenv --no-site-packages -p /usr/bin/python3.4 venv
I have then activated the env using:
source venv/bin/activate
Once in the activated virtualenv i have tried:
sudo pip install https://www.djangoproject.com/download/1.7b1/tarball/
This installs django in the Python 2.7 directory and not in the virtual environment.. Checking with pip freeze shows no installed packages
I read your article it is very interesting and every concept is very clear, thank you so much for sharing. AWS Certification Course in Chennai
Grand Mondial | Casino, Hotels & Casinos - Mapyro
Grand Mondial is 동해 출장마사지 the 수원 출장마사지 Grand Mondial Casino, 정읍 출장샵 Hotel & 포천 출장샵 Casino. See what's available at Grand Mondial and discover your favorite 보령 출장마사지 table games, restaurants, and
Post a Comment