Jul 7, 2016
There are some steps before build a Python application in your Windows. Let's start!
1. install GitI thought almost everyone uses Git as a primary source code management. For Windows. You can download the installation file directly from their website:
With this tutorial, I will do everything in Git-Bash :)
2. install PythonThe step is quite important. You can not run your application if you don't have Python interpreter. Download and install it via
This process will automatically install pip (the name of Python package management system)for you.
3. install virtualenvTo differentiate a version of dependencies which you want to use in each of your application. Installing virtualenv is a good idea. You can install it from pip with this command.
$ pip install virtualenvWhen the installation is successful. It will generate the Envs directory in your home. (~/Envs)
4. create and activate your environment.Let's say I would like to set up an environment for creating a Django application. I will use this command.
$ virtualenv ~/Envs/djangodevThis command will create environment name djangodev and put necessary files into that directory. But it's not finished yet. You have to activate it with this command.
$ source ~/Envs/djangodev/Scripts/activateit will show the environment name in your Git-Bash similar like this
(djangodev) Me@Com MINGW64 ~/Envs/djangodev
5. create requirements.txt and installIn this case, I would like to specify all of the application dependencies with pip. For example, I want to use Django 1.9.7 version. I will specify in requirements.txt with command.
$ echo 'Django==1.9.7' >> requirements.txtand then use pip to install it via
$ pip install -r requirements.txtDjango 1.9.7 is ready to use!
$ python -m django --version 1.9.7