全程离线操作python环境打包及恢复

环境打包

1
2
3
4
5
6
7
8
9
set req=..\req_pkg_py_env.txt
set whs=..\wheels
pip freeze >%req%
pip wheeel -r %req% -w %whs%
pip wheeel pip -w %whs%
pip wheeel setuptools -w %whs%
pip wheeel wheeel -w %whs%
pip uninstall -r %req% -y
pause

环境恢复

1
2
3
4
5
6
set req=..\req_pkg_py_env.txt
set whs=..\wheels
set get-pip=..\get-pip.py
python %get-pip% --no-index --find-links=%whs%
pip install  -r %req% --no-index --find-links=%whs%
pause

环境变量配置

1
2
3
4
5
6
@echo off
set PYTHONHOME=%cd%
set PATH=%PYTHONHOME%/Scripts;%PYTHONHOME%;%PATH% 
set PYTHONPATH=%PYTHONHOME%/Lib
title %PYTHONHOME%\python.execall
cmd

get-pip.py文件来自:https://bootstrap.pypa.io/get-pip.py

2
如无特殊说明,文章均为本站原创,转载请注明出处

该文章由 发布

这货来去如风,什么鬼都没留下!!!