更新时间:2023-12-03 23:15:04
简短答案,不.但是您可以共享venv构建脚本.
Short answer, NO. But you can share the venv build scripts.
pip freeze
将所有库复制到requirements.txt
文件.
pip freeze
all libraries to a requirements.txt
file.
pip freeze > requirements.txt
在每个操作系统上创建虚拟视频:
Create the venv on each OS:
python -m venv env
source env/bin/activate
pip install -r requirements.txt # Install all the libs.
无法在操作系统之间共享venv的原因有几个:
There are several reasons why venvs cannot be shared across OSes: