Python項目中必須包含一個 requirements.txt 檔案,用于記錄所有依賴包及其精确的版本号。以便新環境部署。 1、在虛拟環境中使用pip生成:(venv) $ pip freeze >requirements.txt