P4CaseSyncDocumentation

Reuse the Dependency Environment

Export and Restore Environments

Activate the environment you want to reuse, then export its dependencies with the tool you used to set it up: Conda or pip. Use the matching commands to restore it.

Conda

Export the active environment:

Terminal window
# 当前激活 p4casesync 环境
conda env export > environment.yml

To export only explicitly installed packages, use Conda’s history. The command above exports the active environment.

Restore:

Terminal window
conda env create -f environment.yml
conda activate p4casesync

pip and venv

Export:

Terminal window
# 激活你的 venv 后
pip freeze > requirements.txt

Restore:

Terminal window
# Windows
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
# macOS/Linux
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt