Activate Python virtualenv in current shell #1785
Unanswered
ducdetronquito
asked this question in
Q&A
Replies: 1 comment
-
Currently, there isn't a good way to do this. Each recipe line runs in a new shell, so environment variables loaded in one line don't propagate to the next. You can use a shebang recipe, which runs as a script, to get around this: dev:
#!/usr/bin/env bash
source env/bin/activate |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi ! :)
Here is my use case: when I start working on a python project, I want to type
just dev
in order to enable the virtualenv of this project in the shell i'm working with.Something that would looks like this:
Without using
just
, I would activate the Python virtualenv withsource env/bin/activate
or. env/bin/activate
.But using these commands as a just recipe does not work.
Did you manage to activate a virtualenv in your recipes ?
Thanks in advance and have a nice day 🎅
PS:
My OS is Ubuntu (on WSL2)
PS2: Thanks for making just, it's a pleasure to use :)
Beta Was this translation helpful? Give feedback.
All reactions