diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-03-30 02:17:08 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-03-30 02:17:08 +0100 |
commit | dddb9b1f57d98afc14a92a7ee28259edfaf0c07e (patch) | |
tree | 8e26fcab9c8651093931562b19b186fe6b8f2d1c /venv-trog.sh | |
parent | 7f16bca7f7fdba13267af8724b63396dea6d07da (diff) | |
download | troggle-dddb9b1f57d98afc14a92a7ee28259edfaf0c07e.tar.gz troggle-dddb9b1f57d98afc14a92a7ee28259edfaf0c07e.tar.bz2 troggle-dddb9b1f57d98afc14a92a7ee28259edfaf0c07e.zip |
Struggling to use venv pip with WSL2 Ubuntu-20.04
Diffstat (limited to 'venv-trog.sh')
-rw-r--r-- | venv-trog.sh | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/venv-trog.sh b/venv-trog.sh index 73ecc42..9c7eae8 100644 --- a/venv-trog.sh +++ b/venv-trog.sh @@ -4,32 +4,44 @@ echo 'Run this in a terminal in the troggle directory: "bash venv-trog.sh"' # Expects an Ubuntu 20.04 relatively clean install. # Running using SQLite 3.31.1 2020-01-27 19:55:54 +# Many permissions conflicts under WSL2 mean more sudo needed # If you have not already installed these on your clean Ubuntu install DO THIS FIRST -# /usr/bin/python : ensure python is an alias for python3 not python2.7 +# /usr/bin/python --version : ensure python is an alias for python3 not python2.7 # sudo apt install sqlite3 -# sudo apt install python3-pip +# sudo apt install python3-pip # this installs a shed-load of other stuff: binutils etc. # sudo apt install python3.9 +# sudo apt install python3.9-venv +# sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 + +# on WSL there is an oddity that creating a venv trips over a PowerShell permissions issue + +# and of course: +# sudo apt update +# sudo apt dist-upgrade # On a clean debian 11 (bullseye) installation with Xfce & ssh, # as debian does not install everything that ubuntu does, you need: # sudo usermod -a -G sudo expo # to put expo in sudoers group, re-login required # sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 # sudo apt install python3-pip -# sudo apt piinstall python3-venv +# sudo apt install python3-venv # copy this file and requirements.txt into the directory above where you want to install the VENV -VENAME=d4 # python3.9 and django 4 +VENAME=dj32 # python3.9 and django 3.2 if [ -d requirements.txt ]; then echo "No requirements.txt found. Copy it from your most recent installation." exit 1 fi +python --version + +# LOOK HERE: we go up a level so that /$VENAME is parallel to /troggle cd .. if [ ! -d $VENAME ]; then echo "### Creating venv $VENAME" - python3.9 -m venv $VENAME + sudo python -m venv $VENAME else echo "/$VENAME/ already exists ! Delete it first." exit 1 @@ -39,8 +51,10 @@ fi echo "### Activating $VENAME" cd $VENAME source bin/activate +echo "### Activated." # update local version of pip, more recent than OS version # debian bullseye installs pip 20.3.4 which barfs, we want >22.0.3 +echo "### installing later version of pip inside $VENAME" python -m pip install --upgrade pip PIP=pip @@ -52,8 +66,7 @@ ln -s ../expoweb expoweb ln -s ../troggle troggle ln -s ../loser loser ln -s ../drawings drawings -ln -s /mnt/f/expofiles expofiles -ln -s ../expowebcache expowebcache +ln -s ../expofiles expofiles # Package Version # ------------- ---------- |