最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[记录]Flask环境依赖的安装包

Flask crifan 2581浏览 0评论

参考:

环境 | Flask之旅

去用:

记得先进入虚拟环境中:

workon SIPEvents

然后再去:

(SIPEvents) ➜  SIPEvents pip freeze > requirements.txt
(SIPEvents) ➜  SIPEvents cat requirements.txt 
click==6.6
Flask==0.11.1
gunicorn==19.6.0
itsdangerous==0.24
Jinja2==2.8
MarkupSafe==0.23
pycrypto==2.6.1
requests==2.6.0
six==1.10.0
uWSGI==2.0.13.1
wechat-sdk==0.6.4
Werkzeug==0.11.10
xmltodict==0.10.2

以便于以后去,重新安装和部署环境。

然后以后有空再去:

为生产运行环境 和 开发环境,分别创建对应的:

require_run.txt和require_dev.txt

[后记]

折腾了一段时间,再次去导出依赖的包:

进入虚拟环境:

➜  SIPEvents workon SIPEvents 
ll
(SIPEvents) ➜  SIPEvents ll
total 44K
-rw-r–r– 1 root root  436 Aug 25 16:47 config.py
-rw-r–r– 1 root root  186 Aug 25 16:48 config.pyc
-rw-r–r– 1 root root 6.8K Aug 30 17:53 db_create.py
-rw-r–r– 1 root root  773 Aug 29 17:57 db_manager.py
drwxr-xr-x 2 root root 4.0K Sep  2 15:27 instance
-rw-r–r– 1 root root  204 Aug 22 11:41 requirements.txt
-rw-r–r– 1 root root   77 Aug 23 14:39 run.py
-rw-r–r– 1 root root  266 Aug 23 15:43 run.pyc
drwxr-xr-x 4 root root 4.0K Sep  1 21:57 sipevents
drwxr-xr-x 2 root root 4.0K Aug 21 11:04 toDel

看看pip的freeze的命令的功能:

(SIPEvents) ➜  SIPEvents pip help
Usage:   
  pip <command> [options]
Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion
  help                        Show help for commands.
General Options:
  -h, –help                  Show help.
  –isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.
  -v, –verbose               Give more output. Option is additive, and can be used up to 3 times.
  -V, –version               Show version and exit.
  -q, –quiet                 Give less output.
  –log <path>                Path to a verbose appending log.
  –proxy <proxy>             Specify a proxy in the form [user:passwd@]proxy.server:port.
  –retries <retries>         Maximum number of retries each connection should attempt (default 5 times).
  –timeout <sec>             Set the socket timeout (default 15 seconds).
  –exists-action <action>    Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup.
  –trusted-host <hostname>   Mark this host as trusted, even though it does not have valid or any HTTPS.
  –cert <path>               Path to alternate CA bundle.
  –client-cert <path>        Path to SSL client certificate, a single file containing the private key and the certificate in PEM
                              format.
  –cache-dir <dir>           Store the cache data in <dir>.
  –no-cache-dir              Disable the cache.
  –disable-pip-version-check
                              Don’t periodically check PyPI to determine whether a new version of pip is available for download.
                              Implied with –no-index.

再去执行:

(SIPEvents) ➜  SIPEvents pip freeze > requirements.txt
(SIPEvents) ➜  SIPEvents cat requirements.txt 
alembic==0.8.7
click==6.6
enum34==1.1.6
Flask==0.11.1
Flask-Images==2.1.2
Flask-Login==0.3.2
Flask-Migrate==2.0.0
Flask-Script==2.0.5
Flask-SQLAlchemy==2.1
gunicorn==19.6.0
itsdangerous==0.24
Jinja2==2.8
Mako==1.0.4
MarkupSafe==0.23
PIL==1.1.7
Pillow==3.3.1
pillowcase==2.0.0
pycrypto==2.6.1
python-editor==1.0.1
requests==2.6.0
six==1.10.0
SQLAlchemy==1.1.0b3
uWSGI==2.0.13.1
wechat-sdk==0.6.4
Werkzeug==0.11.10
xmltodict==0.10.2

注:

其中,此处已经没去用:uWSGI

转载请注明:在路上 » [记录]Flask环境依赖的安装包

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.175 seconds, using 22.12MB memory