8.12

7 Req with virtual environments🔗ℹ

Req goes on very nicely with Racket virtual environments.

A popular package for managing Racket virtual environments is raco-pkg-env.

But also the following solution of exporting some environment variables can be used:

rv=$(racket -e "(printf (version))")

export PS1="(venv) ${PS1}"

export PLTUSERHOME="$(pwd)/.cache/venv/${rv}/"

export PATH="$(pwd)/.cache/venv/${rv}/.local/share/racket/${rv}/bin/:${PATH}"

mkdir -p "${PLTUSERHOME}"

The most important of those commands is the one setting PLTUSERHOME.