1)在能聯網的機器上進行以下的準備過程,下載Python 的安裝包。
更新源:
python -m pip install --upgrade pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
2) 在能聯網的機器安裝好所有需要的工具包。
pip install requests
pip install Scrapy
pip install uiautomation
pip install PyYAML
3) 準備好reqiurements.txt文件。
pip freeze >requirements.txt
4) 在能聯網的機器上 下載所需的whl安裝包等。
pip download -d c:\cache -r requirements.txt
5)然後,將reqiurements.txt文件和cache文件夾複製到離線機器上。在離線機器上安裝開發環境及工具包。
pip install --no-index --find-links=c:\cache -r requirements.txt