admin管理员组

文章数量:1296315

Is there a way to activate a Python venv with one command that works on Windows and Unix?

The standard commands are:

  • Windows: venv\Scripts\Activate.ps1
  • Unix: source venv/activate

(There's a handy table of all the options here.)

This is pretty annoying in CI though. Is there a clever way to activate the venv with one command? Doesn't matter if it starts a sub-shell. Something like python3 -m venv activate path/to/venv?

本文标签: pythonCrossplatform command to activate venvStack Overflow