iT邦幫忙

2025 iThome 鐵人賽

0
自我挑戰組

Python 函式大全系列 第 63

Python 模組概說 《 venv 模組 》

  • 分享至 

  • xImage
  •  

✦ 功能:虛擬環境(Virtual Environment)建立工具,為不同專案建立獨立的 Python 環境,避免套件版本衝突

✦ 屬性與方法 :

venv.create()

說明:建立虛擬環境(底層函式)

venv.main()

說明:命令列入口(python -m venv ... 會呼叫)

EnvBuilder.create()

說明:建立環境

EnvBuilder.ensure_directories()

說明:建立目錄結構

EnvBuilder.install_scripts()

說明:開啟 URL,回傳 http.client.HTTPResponse 物件

EnvBuilder.install_scripts()

說明:安裝啟動腳本

https://ithelp.ithome.com.tw/upload/images/20251105/2017799357ZqG4HIW2.jpg


上一篇
Python 模組概說 《 urllib 模組 》
系列文
Python 函式大全63
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言