全程离线操作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

版权声明:
作者:softwolf
链接:http://366tian.org/?p=1708
来源:中天在线 366tian.org
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>