離線Python開發環境的搭建

 

1)在能聯網的機器上進行以下的準備過程,下載Python 的安裝包。

https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe

更新源:

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章