离线安装Python环境

一、Python 环境离线安装(anaconda3)
1. 到anaconda官网下载anaconda安装包,下载地址:https://www.anaconda.com/distribution/
【离线安装Python环境】2. bash Anaconda3-2019.03-Linux-x86_64.sh
3. 配置环境变量:export PATH=/root/anaconda3/bin: $PATH
4. 验证:python
二、Python 环境离线安装(Python3.7.3)
1. 下载python包,下载地址:https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
2. tar zxvf Python-3.7.3.tgz
3. cd Python-3.7.3
4. ./configure --prefix=/usr/local/python3
5. make && make install
6. Python软链接:ln -s /usr/local/python3/bin/python3.7 /usr/local/bin/python3
7. pip软链接:ln -s /usr/local/python3/bin/pip3.7 /usr/local/bin/pip
三. 环境相关依赖包安装
1. 新建一个site-packages文件夹,把python项目有需要的依赖包名称导出到site-packages下的requirements.txt中;
2. pip3 freeze > requirements.txt
3. 下载python项目需要的所有的依赖包:pip3 download -r requirements.txt
4. cd /usr/python-3.7.3/bin
5. pip3 install --no-index --find-links=~/python/site-packages -r requirements.txt
原文链接:https://blog.csdn.net/selfimpro_001/article/details/90956407

    推荐阅读