[Bug]: Dev Containers - Python virtual environment not activated when postCreateCommand
runs
#1122
Labels
bug
Something isn't working
postCreateCommand
runs
#1122
Current Behavior (bug)
The Python virtual environment is not activated by the time that VS Code runs the
postCreateCommand
action. This is because the Python virtual environment is created on demand, rather than during the Docker build phase.To reproduce:
devbox create --template python-pip
cd python-pip
devbox generate devcontainer
.devcontainer/devcontainer.json
:"postCreateCommand": "which python"
code .
When the Configuring... terminal window appears, the path shown is not to the Python virtual environment:
/code/.devbox/virtenv/.wrappers/bin/python
Expected Behavior (fix)
The terminal window should show this path:
/home/devbox/.local/state/devbox/v-933c2/python310Packages.pip/.venv/bin/python
Currently
devbox install
does not create the Python virtual environment, butdevbox run
does. So, a workaround is to modify the Dockerfile by changingRUN devbox install
to
A proper solution would be to change
devbox install
to (optionally?) do the extra initialisation required, or to provide a separatedevbox
command to do this.Additional context
Output of
devbox version -v
:The text was updated successfully, but these errors were encountered: