D:\MySpace\MyWeb2>pip install virtualenv 安装virtualenv
Collecting virtualenv
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection br
oken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:77
7)'),)': /simple/virtualenv/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection br
oken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:77
7)'),)': /simple/virtualenv/
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection br
oken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:77
7)'),)': /packages/b6/30/96a02b2287098b23b875bc8c2f58071c35d2efe84f747b64d523721dc2b5/virtualenv-16.
0.0-py2.py3-none-any.whl
Downloading https://files.pythonhosted.org/packages/b6/30/96a02b2287098b23b875bc8c2f58071c35d2efe8
4f747b64d523721dc2b5/virtualenv-16.0.0-py2.py3-none-any.whl (1.9MB)
100% |████████████████████████████████| 1.9MB 71kB/s
Installing collected packages: virtualenv
The script virtualenv.exe is installed in 'c:\python3\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-s
cript-location.
Successfully installed virtualenv-16.0.0
D:\MySpace\MyWeb2>virtualenv flaskapp 创建名为flaskapp 的virtualenv
Using base prefix 'c:\\python3'
New python executable in D:\MySpace\MyWeb2\flaskapp\Scripts\python.exe
Installing setuptools, pip, wheel...done.
D:\MySpace\MyWeb2>flaskapp\Scripts\activate 激活
(flaskapp) D:\MySpace\MyWeb2>python
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(flaskapp) D:\MySpace\MyWeb2>pip install flask
Collecting flask
Downloading https://files.pythonhosted.org/packages/7f/e7/08578774ed4536d3242b14dacb4696386634607a
f824ea997202cd0edb4b/Flask-1.0.2-py2.py3-none-any.whl (91kB)
100% |████████████████████████████████| 92kB 116kB/s
Collecting Werkzeug>=0.14 (from flask)
Downloading https://files.pythonhosted.org/packages/20/c4/12e3e56473e52375aa29c4764e70d1b8f3efa668
2bef8d0aae04fe335243/Werkzeug-0.14.1-py2.py3-none-any.whl (322kB)
98% |███████████████████████████████▌| 317kB 193kB/s eta 0:00:01
100% |████████████████████████████████| 327kB 186kB/s
Collecting Jinja2>=2.10 (from flask)
Downloading https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277
a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl (126kB)
97% |███████████████████████████████▏| 122kB 163kB/s eta 0:00:01
100% |████████████████████████████████| 133kB 166kB/s
Collecting itsdangerous>=0.24 (from flask)
Downloading https://files.pythonhosted.org/packages/dc/b4/a60bcdba945c00f6d608d8975131ab3f25b22f2b
cfe1dab221165194b2d4/itsdangerous-0.24.tar.gz (46kB)
100% |████████████████████████████████| 51kB 165kB/s
Collecting click>=5.1 (from flask)
Downloading https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d
792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl (71kB)
100% |████████████████████████████████| 71kB 154kB/s
Collecting MarkupSafe>=0.23 (from Jinja2>=2.10->flask)
Downloading https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255
de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz
Building wheels for collected packages: itsdangerous, MarkupSafe
Running setup.py bdist_wheel for itsdangerous ... done
Stored in directory: C:\Users\Administrator\AppData\Local\pip\Cache\wheels\2c\4a\61\5599631c155476
8c6290b08c02c72d7317910374ca602ff1e5
Running setup.py bdist_wheel for MarkupSafe ... done
Stored in directory: C:\Users\Administrator\AppData\Local\pip\Cache\wheels\33\56\20\ebe49a5c612fff
e1c5a632146b16596f9e64676768661e4e46
Successfully built itsdangerous MarkupSafe
Installing collected packages: Werkzeug, MarkupSafe, Jinja2, itsdangerous, click, flask
Successfully installed Jinja2-2.10 MarkupSafe-1.0 Werkzeug-0.14.1 click-6.7 flask-1.0.2 itsdangerous
-0.24
(flaskapp) D:\MySpace\MyWeb2>python
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>from flask import Flask
(执行该语句没有报错证明安装成功)
第一个Flask运行起来了
(flaskapp) D:\MySpace\MyWeb2>python run.py
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 184-739-057
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [09/Jul/2018 15:31:33] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [09/Jul/2018 15:31:34] "GET / HTTP/1.1" 200 -