在线迁移
1
| pip freeze > requirements.txt
|
1
| pip install -r requirements.txt
|
离线迁移(相同平台)
1 2 3 4 5
| pip download -r requirements.txt -d 保存包的目录
pip download 包名 -d 保存包的目录
|
将包上传到离线服务器,解压:
1
| unzip 文件名.zip -d 解压到的目录/
|
1 2 3 4 5
| pip install -r requirements.txt --no-index --find-links=file://依赖包目录的绝对路径
pip install 包名 --no-index --find-links=file://依赖包目录的绝对路径
|
p注意:依赖包目录是指包含所有包的那个目录,比如此处的pd目录
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| . `-- pd |-- Pillow-8.4.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |-- astor-0.8.1-py2.py3-none-any.whl |-- certifi-2021.10.8-py2.py3-none-any.whl |-- charset_normalizer-2.0.12-py3-none-any.whl |-- decorator-5.1.1-py3-none-any.whl |-- idna-3.3-py3-none-any.whl |-- numpy-1.19.5-cp36-cp36m-manylinux2010_x86_64.whl |-- opt_einsum-3.3.0-py3-none-any.whl |-- paddle_bfloat-0.1.2-cp36-cp36m-manylinux_2_27_x86_64.whl |-- paddlepaddle_gpu-2.3.0.post112-cp36-cp36m-linux_x86_64.whl |-- protobuf-3.19.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |-- requests-2.27.1-py2.py3-none-any.whl |-- six-1.16.0-py2.py3-none-any.whl `-- urllib3-1.26.9-py2.py3-none-any.whl
|