Skip to content

Activating virtual environment in postCreateCommand #152272

Discussion options

You must be logged in to vote

Having the venv in the home directory fixed it:

FROM mcr.microsoft.com/devcontainers/go:1.23

RUN sudo apt-get update \
    && sudo apt-get install -y \
    && apt install python3.11-venv -y \
    && python3 -m venv /home/vscode/venv \
    && /home/vscode/venv/bin/pip install jupyterlab
"postCreateCommand": "/home/vscode/venv/bin/python -m jupyterlab --allow-root --no-browser",

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@paololazzari
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by paololazzari
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Codespaces Your development environment, in the cloud. Run VS Code and code on GitHub's cloud platform, Question
2 participants