Premise:
1. The Python version is installed (typically 2. X
2. Easy_install installed
Python installation, remember to configure the environment variables for Python, for example: I add G:\Python directly to the path
Verify installation python succeeded: cmd input python or python-v
--------------------------------------------------------------------------------------------------------------- ------------------------------------
This is the website of download Easy_install
: Http://pypi.python.org/pypi/setuptools can find the correct version to download.
Win7 32-bit can download setuptools-0.6c11.win32-py2.7.exe.
The Win7 64-bit must be installed using ez_setup.py.
The following is a download of my 64-bit
I have this:
Https://pypi.python.org/packages/ba/2c/743df41bd6b3298706dfe91b0c7ecdc47f2dc1a3104abeb6e9aa4a45fa5d/ez_setup-0.9.tar.gz
Download ez_setup.py after decompression, under CMD into the path just extracted, execute Python ez_setup.py, can be installed automatically.
After installing Easy_install, add the directory where the Easy_install is located in the path of the system environment variable, for example: G:\Python\Scripts
- Enter Easy_install virtualenv in cmd, install virtualenv, this is mainly used to do the interpreter environment isolation
- Select a disk to configure the virtual environment, such as D-Drive
- CMD into D-Disk, execute: virtualenv myvir, get myvir Virtual Environment file directory in D disk
Then CD to the Myvir directory under scripts, enter Activate.bat
- Then enter Easy_install Flask
Test: hello.py saved in D:\myvir\Scripts
-
from flask import Flask app =flask (__name__ ) @app. Route ( " / " ) def Hello_world (): return
hello World " if __name__ = = " __main__ " : App.run ()
Execute Python hello.py
- Open URL http://127.0.0.1:5000, install flask successfully
An experience with the quick installation of flask under Windows