PG1X WIKI

My Knowledge Base

User Tools

Site Tools


tech:se:python:pyenv:pyenv

pyenv

wnoguchi@lasthope:~$ sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
Hit:1 https://downloads.1password.com/linux/debian edge InRelease
Hit:2 http://packages.microsoft.com/repos/code stable InRelease                                                                      
Hit:4 http://dl.google.com/linux/chrome/deb stable InRelease                                                                         
Hit:5 http://ppa.launchpad.net/nextcloud-devs/client/ubuntu focal InRelease                                             
Hit:6 http://jp.archive.ubuntu.com/ubuntu focal InRelease                                 
Get:7 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Get:8 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]     
Hit:3 https://packagecloud.io/github/git-lfs/ubuntu focal InRelease                       
Get:9 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]              
Get:10 http://jp.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [421 kB]
Get:11 http://jp.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [807 kB]
Get:12 http://jp.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [264 kB]
Get:13 http://jp.archive.ubuntu.com/ubuntu focal-updates/main DEP-11 48x48 Icons [53.9 kB]          
Get:14 http://jp.archive.ubuntu.com/ubuntu focal-updates/main DEP-11 64x64 Icons [87.9 kB]      
Get:15 http://jp.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [740 kB]       
Get:16 http://jp.archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages [549 kB]   
Get:17 http://jp.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [302 kB]
Get:18 http://jp.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [2,468 B]        
Get:19 http://jp.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [1,764 B]          
Get:20 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [24.3 kB]                 
Get:21 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [57.5 kB]
Fetched 3,634 kB in 2s (1,753 kB/s)         
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
make is already the newest version (4.2.1-1.2).
make set to manually installed.
wget is already the newest version (1.20.3-1ubuntu1).
build-essential is already the newest version (12.8ubuntu1.1).
curl is already the newest version (7.68.0-1ubuntu2.4).
xz-utils is already the newest version (5.2.4-1ubuntu1).
xz-utils set to manually installed.
zlib1g-dev is already the newest version (1:1.2.11.dfsg-2ubuntu1.2).
zlib1g-dev set to manually installed.
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-42 linux-headers-5.4.0-42-generic linux-image-5.4.0-42-generic linux-modules-5.4.0-42-generic
  linux-modules-extra-5.4.0-42-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  binfmt-support icu-devtools libfontconfig1-dev libfreetype-dev libfreetype6-dev libgcrypt20-dev libgmp-dev libgmpxx4ldbl
  libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev libgnutlsxx28 libgpg-error-dev libice-dev libicu-dev libidn2-dev libllvm10
  libncurses-dev libnspr4-dev libnss3-dev libp11-kit-dev libpfm4 libpng-dev libpthread-stubs0-dev libsm-dev libtasn1-6-dev libtcl8.6
  libtk8.6 libunbound8 libx11-dev libxau-dev libxcb1-dev libxdmcp-dev libxext-dev libxft-dev libxmlsec1-gcrypt libxmlsec1-gnutls
  libxmlsec1-openssl libxrender-dev libxslt1-dev libxss-dev libxt-dev llvm-10 llvm-10-runtime llvm-runtime nettle-dev tcl tcl-dev
  tcl8.6 tcl8.6-dev tk tk8.6 tk8.6-dev uuid-dev x11proto-core-dev x11proto-dev x11proto-scrnsaver-dev x11proto-xext-dev
  xorg-sgml-doctools xtrans-dev
Suggested packages:
  freetype2-doc libgcrypt20-doc gmp-doc libgmp10-doc libmpfr-dev gnutls-bin gnutls-doc libice-doc icu-doc liblzma-doc ncurses-doc
  readline-doc libsm-doc sqlite3-doc libssl-doc libx11-doc libxcb-doc libxext-doc libxt-doc llvm-10-doc tcl-doc tcl-tclreadline
  tcl8.6-doc tk-doc tk8.6-doc
Recommended packages:
  bzip2-doc libpng-tools libtasn1-doc llvm-10-dev
The following NEW packages will be installed:
  binfmt-support icu-devtools libbz2-dev libffi-dev libfontconfig1-dev libfreetype-dev libfreetype6-dev libgcrypt20-dev libgmp-dev
  libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev libgnutlsxx28 libgpg-error-dev libice-dev libicu-dev libidn2-dev
  libllvm10 liblzma-dev libncurses-dev libncurses5-dev libnspr4-dev libnss3-dev libp11-kit-dev libpfm4 libpng-dev
  libpthread-stubs0-dev libreadline-dev libsm-dev libsqlite3-dev libssl-dev libtasn1-6-dev libtcl8.6 libtk8.6 libunbound8 libx11-dev
  libxau-dev libxcb1-dev libxdmcp-dev libxext-dev libxft-dev libxml2-dev libxmlsec1-dev libxmlsec1-gcrypt libxmlsec1-gnutls
  libxmlsec1-openssl libxrender-dev libxslt1-dev libxss-dev libxt-dev llvm llvm-10 llvm-10-runtime llvm-runtime nettle-dev tcl
  tcl-dev tcl8.6 tcl8.6-dev tk tk-dev tk8.6 tk8.6-dev uuid-dev x11proto-core-dev x11proto-dev x11proto-scrnsaver-dev
  x11proto-xext-dev xorg-sgml-doctools xtrans-dev
0 upgraded, 71 newly installed, 0 to remove and 17 not upgraded.
Need to get 45.8 MB of archives.
After this operation, 212 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://jp.archive.ubuntu.com/ubuntu focal/universe amd64 binfmt-support amd64 2.2.0-2 [58.2 kB]
Get:2 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 icu-devtools amd64 66.1-2ubuntu2 [188 kB]
Get:3 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 libbz2-dev amd64 1.0.8-2 [30.2 kB]
Get:4 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 libpng-dev amd64 1.6.37-2 [175 kB]
Get:5 http://jp.archive.ubuntu.com/ubuntu focal-updates/main amd64 libfreetype-dev amd64 2.10.1-2ubuntu0.1 [493 kB]
Get:6 http://jp.archive.ubuntu.com/ubuntu focal-updates/main amd64 libfreetype6-dev amd64 2.10.1-2ubuntu0.1 [9,812 B]

(snip)
wnoguchi@lasthope:~$ curl https://pyenv.run | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   285  100   285    0     0    269      0  0:00:01  0:00:01 --:--:--   269
Cloning into '/home/wnoguchi/.pyenv'...
remote: Enumerating objects: 736, done.
remote: Counting objects: 100% (736/736), done.
remote: Compressing objects: 100% (489/489), done.
remote: Total 736 (delta 389), reused 340 (delta 154), pack-reused 0
Receiving objects: 100% (736/736), 402.20 KiB | 731.00 KiB/s, done.
Resolving deltas: 100% (389/389), done.
Cloning into '/home/wnoguchi/.pyenv/plugins/pyenv-doctor'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 11 (delta 1), reused 2 (delta 0), pack-reused 0
Unpacking objects: 100% (11/11), 38.62 KiB | 217.00 KiB/s, done.
Cloning into '/home/wnoguchi/.pyenv/plugins/pyenv-installer'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 16 (delta 1), reused 8 (delta 0), pack-reused 0
Unpacking objects: 100% (16/16), 5.99 KiB | 3.00 MiB/s, done.
Cloning into '/home/wnoguchi/.pyenv/plugins/pyenv-update'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 10 (delta 1), reused 6 (delta 0), pack-reused 0
Unpacking objects: 100% (10/10), 2.66 KiB | 2.66 MiB/s, done.
Cloning into '/home/wnoguchi/.pyenv/plugins/pyenv-virtualenv'...
remote: Enumerating objects: 57, done.
remote: Counting objects: 100% (57/57), done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 57 (delta 11), reused 20 (delta 0), pack-reused 0
Unpacking objects: 100% (57/57), 34.86 KiB | 254.00 KiB/s, done.
Cloning into '/home/wnoguchi/.pyenv/plugins/pyenv-which-ext'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (6/6), done.
Unpacking objects: 100% (10/10), 2.92 KiB | 2.92 MiB/s, done.
remote: Total 10 (delta 1), reused 6 (delta 0), pack-reused 0

WARNING: seems you still have not added 'pyenv' to the load path.

# Load pyenv automatically by adding
# the following to ~/.bashrc:

export PATH="/home/wnoguchi/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
~/.bashrc
# pyenv
export PATH=$HOME/.pyenv/bin:$PATH
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
wnoguchi@lasthope:~$ exec $SHELL
wnoguchi@lasthope:~$ pyenv install --list | grep 3.6.9
  3.6.9
wnoguchi@lasthope:~$ pyenv install 3.6.9
Downloading Python-3.6.9.tar.xz...
-> https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
Installing Python-3.6.9...
Installed Python-3.6.9 to /home/wnoguchi/.pyenv/versions/3.6.9
wnoguchi@lasthope:~/Documents/technology/information/cloud/openstack/src/upstream$ pyenv local 3.6.9
wnoguchi@lasthope:~/Documents/technology/information/cloud/openstack/src/upstream$ python -V
Python 3.6.9

References

tech/se/python/pyenv/pyenv.txt · Last modified: 2021/02/17 15:06 by wnoguchi