Re-spawining pod fails after creating venv

Hi,

After the user logs in, and creates a virtual environment with the following commands in terminal:

python3 -m venv my_new_env

source my_new_env/bin/activate

pip install ipykernel

python -m ipykernel install --user --name=my_new_env --display-name “Python (my_new_env)”

the environment is shown and usable.

BUT, after the pod is deleted and re-created after next login, the pod cannot start, and there’s spawn failure. so creating a venv interferes with re-spawning the pod.

  • how to resolve the matter?
  • what is the standard procedure to create a separate venv?

Thanks, Looking forward.

The best option is to include all Virtualenvs in your image.

It should be possible to install them at runtime, but you need to ensure everything is in a persistent home directory, and not in the container’s ephemeral file system