From 06cbe3cf6cfac2a8195872bae3b0009ee06b84a1 Mon Sep 17 00:00:00 2001 From: Jon Massey Date: Mon, 20 May 2024 22:08:15 +0100 Subject: [PATCH] Use system pip3 rather than venv pip3 Following https://github.com/opensafely-core/research-template-docker/pull/26 which added venv activation into .bashrc for the rstudio user (the default user for our codespaces/devcontainer configuration), calling `pip3` would call /opt/venv/bin/pip3. Within a virtualenv, the `--user` option is not allowed and users reported this error. Instead we decouple the installation of opensafely-cli from the venv so it is always available regardless of virtualenv state. --- .devcontainer/postCreate.sh | 2 +- analysis/stata.do | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 analysis/stata.do diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh index 3e43d44..6d1e562 100644 --- a/.devcontainer/postCreate.sh +++ b/.devcontainer/postCreate.sh @@ -2,7 +2,7 @@ set -euo pipefail -pip3 install --user -r .devcontainer/requirements.in +/usr/local/bin/pip3 install --user -r .devcontainer/requirements.in #set R working directory ! grep -q "$1" $R_HOME/etc/Rprofile.site && sudo tee -a $R_HOME/etc/Rprofile.site <<< "setwd(\"$1\")" diff --git a/analysis/stata.do b/analysis/stata.do new file mode 100644 index 0000000..0983157 --- /dev/null +++ b/analysis/stata.do @@ -0,0 +1 @@ +capture noisily import delimited ./output/output/dataset.csv, clear