【美今詩歌集】【作者:童驛采】1999年~2020年 |訪問首頁|
  【墨龍字畫】 墨界音樂 墨龍愛導航 我啦傳媒 『墨龍』畫堂 | 童驛采 【論壇】-字畫譚 楊冪量子景觀設計師
墨龍商務 【龍帝字畫】 楊鈺瑩 童驛采墨韻論壇 墨龍電視台BBS     篁宮字畫BBS 台灣字畫BBS  
操作系統字畫 數字字畫BBS 墨龍藝術 量子景觀設計師       ●腾讯企鹅98 墨龍

操作系統字畫

 找回密碼
 注冊發言【僅限墨文】
搜索
查看: 1|回復: 0

How to Keep Python Project Dependencies Separate on Windows

[複製鏈接]

94

主題

0

回帖

286

積分

中級會員

Rank: 3Rank: 3

積分
286
發表於 5 小時前 | 顯示全部樓層 |閱讀模式
Installing several Python packages globally can make it difficult to reproduce a project when two applications require different library versions. A virtual environment is a practical solution for Python development on Windows 11 and Windows 10.

Open a terminal in the project folder and run py -m venv .venv if the Python launcher is available. In Command Prompt, activate it with .venv\Scripts\activate.bat. Install packages using python -m pip install followed by the package name. Check the active interpreter before running scripts.

For anyone preparing a free Python 64-bit installation, my website includes information about Python for Windows 11 64-bit. Choose the official installer appropriate for the PC architecture and supported operating system.

Record dependencies with python -m pip freeze > requirements.txt when appropriate. Avoid committing the virtual environment itself to version control. A new environment can then be created on another computer using the recorded requirements.

本版積分規則

操作系統字畫

GMT+8, 2026-11-29 05:43 , Processed in 0.024425 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回復 返回頂部 返回列表