xshell-venv
manages your Python virtual environments in code.
xshell-venv
is an extension to xshell, the swiss-army knife for writing cross-platform “bash” scripts in Rust.
use xshell_venv::{Shell, VirtualEnv};
let sh = Shell::new()?;
let venv = VirtualEnv::new(&sh, "py3")?;
venv.run("print('Hello World!')")?; // "Hello World!"
- Python 3
- On Windows we look for
python3.exe
orpython.exe
- Otherwise we look for
python3
orpython
- On Windows we look for
- The
venv
package- This might be available as
python3-venv
or under a similar name. Double check your packages. E.g. on Ubuntu Python 3.8 is available aspython3.8
and the correspondingvenv
package is namedpython3.8-venv
.
- This might be available as
MIT.