Projects/pyv
Jump to navigation
Jump to search
Ok so this is a project to make a python installer that works like this
> brew install pyv > apt install pyv
Then
> pyv latest
will install the latest version of python.
Let's make a script called pyv.sh for starters
Here it is
#!/usr/bin/env bash pyv_install() { echo do install here ver $1 } pyv_list() { echo list versions } if test $# -eq 0; then echo "usage: pyv <version>" else case "$1" in list) pyv_list $@; exit;; *) pyv_install "$1"; exit;; esac fi
Meanwhile I installed python-build from pyenv and used that to install python 3.11.1 to /usr/local in docker:
docker run -it ubuntu
root@1fcf7b43929e:/usr/local# history 1 apt 2 apt update 3 python3 4 git 5 apt install git 6 ls 7 cd home 8 ls 9 git clone https://github.com/pyenv/pyenv 10 cd pyenv/ 11 ls 12 cd plugins/ 13 ls 14 cd 15 cd - 16 cd python-build/ 17 ls 18 cat install.sh 19 python-build 20* sh install.sh 21 python-build 22 python-build --definitions 23 python-build 3.11.1 24 ls /usr/local/bin/ 25 python-build 3.11.1 /usr/local/bin/ 26 sudo apt install curl 27 apt install curl 28 python-build 3.11.1 /usr/local/bin/ 29 sudo apt install gcc 30 apt install gcc 31 python-build 3.11.1 /usr/local/bin/ 32 apt install make 33 python-build 3.11.1 /usr/local/bin/ 34 vi /tmp/python-build.20230119040508.13746.log 35 less /tmp/python-build.20230119040508.13746.log 36 sudo apt install zlib 37 apt install zlib 38 apt search zlib 39 less /tmp/python-build.20230119040508.13746.log 40 apt install zlib1g 41 apt install zlib1g-dev 42 python-build 3.11.1 /usr/local/bin/ 43 python-build --help 44 python-build 3.11.1 /usr/local/bin/ --verbose 45 python 46 python3 47 apt install openssl 48 apt install libopenssl-dev 49 apt install libopenssl 50 apt install openssl-dev 51 apt install libssl-dev 52 apt install libreadline 53 apt install readline 54 apt install libreadline-dev 55 python-build 3.11.1 /usr/local/bin/ --verbose 56 apt search lzma 57 apt install lzma-dev 58 python-build 3.11.1 /usr/local/bin/ --verbose 59 python 60 python3 61 apt search libffi 62 apt install libffi-dev 63 python-build 3.11.1 /usr/local/bin/ --verbose 64 python3 65 python 66 cd /usr/local/bin/ 67 ls 68 cd bin/ 69 ls 70 cd .. 71 ls 72 rm -r bin/ include/ lib/ share/ 73 cd .. 74 echo $PATH 75 python-build 3.11.1 /usr/local/ --verbose 76 python3 77 python 78 history
That's a bit messy but it's got the right parts. Now just need a way to resolve the latest version, and the prototype of this script is pretty much done.
Re: getting latest version: this is relevant: https://stackoverflow.com/questions/29687140/install-latest-python-version-with-pyenv