Unable to Use Poetry Python Virtualenv #616
-
I posted a similar issue before but never really found an answer. I am wondering how people are handling creating/using Python virtualenvs. In the example below, I attempt to source a Example Taskfile showing the issue---
version: '3'
tasks:
one:
cmds:
- task: two
- pip3 install ansible
two:
interactive: true
label: three
desc: Hey
cmds:
- poetry env info --path
- . "/home/hawkz/.cache/pypoetry/virtualenvs/hawkz-iL5HU4tf-py3.9/bin/activate" |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I converted this issues into a discussion as it's not exactly a bug. I don't do Python so it's not trivial for me to try to help you. I suppose that if you run it before every command that would work. I think it'd be interested at #204 which tries to solve use cases like this. |
Beta Was this translation helpful? Give feedback.
-
That is simple and would break any environment manager tool, including python virtualenv, likely rbenv and nvm too. Each command entry under The workaround is to write an entire shell script as a single command: cmds:
- |
activate
echo 123
... |
Beta Was this translation helpful? Give feedback.
That is simple and would break any environment manager tool, including python virtualenv, likely rbenv and nvm too.
Each command entry under
cmds
list is a standalone shell, so it will inherit nothing from the previous command, so basically you will not have the virtualenv activated,The workaround is to write an entire shell script as a single command: