pip freeze >/tmp/wheel_pip/requirements.txt
這個命令會把當前環境下面的pip安裝包名,都放到文件中html
pip wheel --wheel-dir=/tmp/wheel_pip pip pip wheel --wheel-dir=/tmp/wheel_pip wheel
若是沒有wheel,就pip install wheel
安裝python
pip wheel --wheel-dir=/tmp/wheel_pip -r requirements.txt
wget https://bootstrap.pypa.io/get-pip.py
tar cf /tmp/wheel_pip wheel_pip.tar
把wheel_pip.tar
複製到離線的服務器,解壓bootstrap
cd /tmp/ & tar xf wheel_pip.tar ./
python get-pip.py --no-index --find-links=/tmp/wheel_pip
pip install --no-index --find-links=/tmp/wheel_pip wheel
pip install --no-index --find-links=/tmp/wheel_pip -r requirements.txt pip install --no-index --find-links=/data1/upload/wheel_pip -r /data1/upload/wheel_pip/requirements.txt
pip wheel --wheel-dir=/data1/anchor/lujianxing/ celery #指定包的版本 pip wheel --wheel-dir=/data1/anchor/lujianxing/ celery==3.1.18
wheel包的地址服務器
ll /data1/anchor/lujianxing/celery-3.1.18-py2.py3-none-any.whl
cd /data1/upload/ pip install celery-3.1.18-py2.py3-none-any.whl
未經許可,請不要轉載。ui
參考code