龙空技术网

统信UOS/麒麟KYLINOS上安装python特定版本

鹏大圣运维 164

前言:

此时你们对“python372下载安装教程”大约比较着重,看官们都想要学习一些“python372下载安装教程”的相关内容。那么小编同时在网摘上网罗了一些关于“python372下载安装教程””的相关内容,希望我们能喜欢,兄弟们一起来了解一下吧!

原文链接:统信UOS/麒麟KYLINOS上安装python特定版本

hello,大家好啊!Python作为一种广泛使用的编程语言,其版本多样性给开发者带来了既便利又挑战的情况。不同的项目可能需要不同版本的Python,而在统信UOS/麒麟KYLINOS这样的操作系统上,如何灵活地管理和切换Python版本,就成为了一个值得探讨的话题。今天,我要给大家介绍的是如何在这两个操作系统上使用pyenv来安装和管理特定版本的Python。

为什么选择pyenv?

pyenv是一个非常流行的Python版本管理工具。它的主要优势在于:

支持多版本管理:pyenv可以让你在同一台机器上安装和管理多个Python版本,非常适合需要在不同项目间切换Python环境的开发者。易于切换版本: 通过简单的命令,你可以轻松切换到不同的Python版本,无需手动配置复杂的环境变量。简化安装过程:pyenv提供了一种简化的方式来安装和编译Python,使得在不同系统上安装特定版本的Python变得更加容易。

希望这篇文章能帮助到需要在这些操作系统上使用Python的朋友们。如果你有任何问题或者更多的经验分享,请在评论区留言,我们一起讨论。如果你觉得这篇文章有用,别忘了分享转发,点个在看和关注哦!让我们一起探索和学习更多关于Python和Linux系统的知识!

1、查看系统信息

pdsyw@pdsyw-PC:~/Desktop$ cat /etc/os-version [Version] SystemName=UOS DesktopSystemName[zh_CN]=统信桌面操作系统ProductType=DesktopProductType[zh_CN]=桌面EditionName=ProfessionalEditionName[zh_CN]=专业版MajorVersion=20MinorVersion=1060OsBuild=11018.100.100pdsyw@pdsyw-PC:~/Desktop$ pdsyw@pdsyw-PC:~/Desktop$ uname -aLinux pdsyw-PC 4.19.0-amd64-desktop #6034 SMP Thu Aug 17 14:31:55 CST 2023 x86_64 GNU/Linuxpdsyw@pdsyw-PC:~/Desktop$ 

2、查看python版本

pdsyw@pdsyw-PC:~/Desktop$ python --versionPython 2.7.16pdsyw@pdsyw-PC:~/Desktop$ pdsyw@pdsyw-PC:~/Desktop$ python3 --versionPython 3.7.3pdsyw@pdsyw-PC:~/Desktop$ 

3、安装pyenv依赖

pdsyw@pdsyw-PC:~/Desktop$ 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命中:1  eagle InRelease命中:2  eagle/1060 InRelease                         命中:5  eagle InRelease                          命中:3  eagle InRelease获取:4  eagle-pro InRelease [6,134 B]获取:6  eagle-pro/appstore amd64 Packages [2,815 kB]已下载 2,821 kB,耗时 2秒 (1,489 kB/s)正在读取软件包列表... 完成正在读取软件包列表... 完成正在分析软件包的依赖关系树       正在读取状态信息... 完成       libssl-dev 已经是最新版 (1.1.1d.21-deepin1)。libssl-dev 已设置为手动安装。make 已经是最新版 (4.2.1-1.2)。make 已设置为手动安装。wget 已经是最新版 (1.20.1.4-1+eagle)。wget 已设置为手动安装。xz-utils 已经是最新版 (5.2.4.1-1+dde)。curl 已经是最新版 (7.64.1.18-deepin1)。curl 已设置为手动安装。下列软件包是自动安装的并且现在不需要了:  libutempter0 squashfs-tools x11-apps x11-session-utils xbitmaps xinit使用'sudo apt autoremove'来卸载它(它们)。将会同时安装下列软件:  binfmt-support g++ g++-8 libexpat1-dev libfontconfig1-dev libfreetype6-dev libgcrypt20-dev  libgmp-dev libgnutls28-dev libgpg-error-dev libice-dev libicu-dev libidn2-dev libncurses-dev  libnspr4-dev libnss3-dev libp11-kit-dev libpng-dev libpthread-stubs0-dev libsm-dev  libstdc++-8-dev libtasn1-6-dev libtk8.6 libx11-dev libxau-dev libxcb1-dev libxdmcp-dev  libxext-dev libxft-dev libxmlsec1-gcrypt libxmlsec1-gnutls libxmlsec1-nss libxrender-dev  libxslt1-dev libxss-dev libxt-dev llvm-7 llvm-7-runtime llvm-runtime nettle-dev tcl tcl-dev  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建议安装:  g++-multilib g++-8-multilib gcc-8-doc libstdc++6-8-dbg 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 libstdc++-8-doc libx11-doc libxcb-doc libxext-doc libxt-doc  llvm-7-doc tcl-doc tcl8.6-doc tk-doc tk8.6-doc推荐安装:  bzip2-doc libpng-tools libtasn1-doc llvm-7-dev xterm | x-terminal-emulator下列【新】软件包将被安装:  binfmt-support build-essential g++ g++-8 libbz2-dev libexpat1-dev libffi-dev libfontconfig1-dev  libfreetype6-dev libgcrypt20-dev libgmp-dev libgnutls28-dev libgpg-error-dev libice-dev  libicu-dev libidn2-dev liblzma-dev libncurses-dev libncurses5-dev libnspr4-dev libnss3-dev  libp11-kit-dev libpng-dev libpthread-stubs0-dev libreadline-dev libsm-dev libsqlite3-dev  libstdc++-8-dev libtasn1-6-dev libtk8.6 libx11-dev libxau-dev libxcb1-dev libxdmcp-dev  libxext-dev libxft-dev libxml2-dev libxmlsec1-dev libxmlsec1-gcrypt libxmlsec1-gnutls  libxmlsec1-nss libxrender-dev libxslt1-dev libxss-dev libxt-dev llvm llvm-7 llvm-7-runtime  llvm-runtime nettle-dev tcl tcl-dev 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 zlib1g-dev升级了 0 个软件包,新安装了 65 个软件包,要卸载 0 个软件包,有 28 个软件包未被升级。需要下载 40.2 MB 的归档。解压缩后会消耗 163 MB 的额外空间。您希望继续执行吗? [Y/n] y获取:2  eagle/1060/main amd64 libncurses-dev amd64 6.1.3-deepin1 [340 kB]获取:1  eagle/main amd64 binfmt-support amd64 2.2.0-2 [70.0 kB]获取:5  eagle/main amd64 libstdc++-8-dev amd64 8.3.0.10-deepin1 [1,532 kB]获取:6  eagle/main amd64 g++-8 amd64 8.3.0.10-deepin1 [9,697 kB]获取:7  eagle/main amd64 g++ amd64 4:8.3.0-1 [1,644 B]获取:8  eagle/main amd64 build-essential amd64 12.6 [7,576 B]获取:9  eagle/main amd64 libbz2-dev amd64 1.0.6.2-deepin2 [30.0 kB]获取:10  eagle/main amd64 libexpat1-dev amd64 2.2.6.5-deepin1 [146 kB]获取:11  eagle/main amd64 libffi-dev amd64 3.2.1.2-1+dde [163 kB]获取:12  eagle/main amd64 zlib1g-dev amd64 1:1.2.12.5-1+dde [209 kB]获取:13  eagle/main amd64 libpng-dev amd64 1.6.36.2-2+dde [282 kB]获取:14  eagle/main amd64 libfreetype6-dev amd64 2.9.1.2-1-deepin1 [514 kB]获取:15  eagle/main amd64 uuid-dev amd64 2.33.1.19-1+dde [96.1 kB]获取:16  eagle/main amd64 libfontconfig1-dev amd64 2.13.1.1-2 [964 kB]获取:17  eagle/main amd64 libgpg-error-dev amd64 1.35.3-1+dde [123 kB]获取:18  eagle/main amd64 libgcrypt20-dev amd64 1.8.4.2-1+dde [621 kB]获取:19  eagle/main amd64 libgmp-dev amd64 2:6.1.2.2-1+dde [626 kB]获取:20  eagle/main amd64 libidn2-dev amd64 2.0.5.1-1+dde [75.9 kB]获取:21  eagle/main amd64 libp11-kit-dev amd64 0.23.15.3-1+dde [196 kB]获取:22  eagle/main amd64 libtasn1-6-dev amd64 4.13.1-deepin1 [103 kB]获取:23  eagle/main amd64 nettle-dev amd64 3.4.1.2-1 [1,079 kB]获取:24  eagle/main amd64 libgnutls28-dev amd64 3.6.7.8-deepin1 [1,083 kB]获取:3  eagle/1060/main amd64 libncurses5-dev amd64 6.1.3-deepin1 [10.6 kB]获取:25  eagle/main amd64 xorg-sgml-doctools all 1:1.11-1 [22.0 kB]获取:26  eagle/main amd64 x11proto-dev all 2018.4-4 [251 kB]获取:27  eagle/main amd64 x11proto-core-dev all 2018.4-4 [3,128 B]获取:28  eagle/main amd64 libice-dev amd64 2:1.0.9-2 [67.4 kB]获取:29  eagle/main amd64 libicu-dev amd64 63.1.3-1+dde [9,150 kB]获取:4  eagle/1060/main amd64 libx11-dev amd64 2:1.6.12.4-deepin1 [663 kB]获取:30  eagle/main amd64 liblzma-dev amd64 5.2.4.1-1+dde [210 kB]获取:31  eagle/main amd64 libnspr4-dev amd64 2:4.20.1-1+dde [213 kB]获取:32  eagle/main amd64 libnss3-dev amd64 2:3.42.1.8-1+deepin1 [225 kB]获取:33  eagle/main amd64 libpthread-stubs0-dev amd64 0.4-1 [5,344 B]获取:34  eagle/main amd64 libreadline-dev amd64 7.0-5 [133 kB]获取:35  eagle/main amd64 libsm-dev amd64 2:1.2.3-1 [37.9 kB]获取:36  eagle/main amd64 libsqlite3-dev amd64 3.39.3-1 [993 kB]获取:37  eagle/main amd64 libtk8.6 amd64 8.6.9-2 [767 kB]获取:38  eagle/main amd64 libxau-dev amd64 1:1.0.8.1-1+rebuild [20.7 kB]获取:39  eagle/main amd64 libxdmcp-dev amd64 1:1.1.2-3 [42.4 kB]获取:40  eagle/main amd64 xtrans-dev all 1.3.5-1 [100 kB]获取:41  eagle/main amd64 libxcb1-dev amd64 1.13.1-2 [174 kB]获取:42  eagle/main amd64 x11proto-xext-dev all 2018.4-4 [3,128 B]获取:43  eagle/main amd64 libxext-dev amd64 2:1.3.3.1-1+rebuild [104 kB]获取:44  eagle/main amd64 libxrender-dev amd64 1:0.9.10-1 [41.0 kB]获取:45  eagle/main amd64 libxft-dev amd64 2.3.2-2 [68.4 kB]获取:46  eagle/main amd64 libxml2-dev amd64 2.9.4.6.3-deepin1 [769 kB]获取:47  eagle/main amd64 libxmlsec1-gcrypt amd64 1.2.27-2 [65.4 kB]获取:48  eagle/main amd64 libxmlsec1-gnutls amd64 1.2.27-2 [57.1 kB]获取:49  eagle/main amd64 libxmlsec1-nss amd64 1.2.27-2 [86.2 kB]获取:50  eagle/main amd64 libxslt1-dev amd64 1.1.32.5-deepin1 [515 kB]获取:51  eagle/main amd64 libxmlsec1-dev amd64 1.2.27-2 [414 kB]获取:52  eagle/main amd64 x11proto-scrnsaver-dev all 2018.4-4 [3,136 B]获取:53  eagle/main amd64 libxss-dev amd64 1:1.2.3-1 [23.5 kB]获取:54  eagle/main amd64 libxt-dev amd64 1:1.1.5.1.1-1+dde [420 kB]获取:55  eagle/main amd64 llvm-7-runtime amd64 1:7.0.1-8 [190 kB]获取:56  eagle/main amd64 llvm-runtime amd64 1:7.0-47 [7,132 B]获取:57  eagle/main amd64 llvm-7 amd64 1:7.0.1-8 [4,553 kB]获取:58  eagle/main amd64 llvm amd64 1:7.0-47 [9,472 B]获取:59  eagle/main amd64 tcl amd64 8.6.9+1 [5,636 B]获取:60  eagle/main amd64 tcl8.6-dev amd64 8.6.9.1-deepin1 [1,001 kB]获取:61  eagle/main amd64 tcl-dev amd64 8.6.9+1 [8,204 B]获取:62  eagle/main amd64 tk8.6 amd64 8.6.9-2 [72.1 kB]获取:63  eagle/main amd64 tk amd64 8.6.9+1 [5,676 B]获取:64  eagle/main amd64 tk8.6-dev amd64 8.6.9-2 [757 kB]获取:65  eagle/main amd64 tk-dev amd64 8.6.9+1 [5,504 B]已下载 40.2 MB,耗时 9秒 (4,652 kB/s)                                                              正在从软件包中解出模板:100%正在选中未选择的软件包 binfmt-support。(正在读取数据库 ... 系统当前共安装有 202412 个文件和目录。)准备解压 .../00-binfmt-support_2.2.0-2_amd64.deb  ...正在解压 binfmt-support (2.2.0-2) .../var/cache/apt/archives/binfmt-support_2.2.0-2_amd64.deb正在选中未选择的软件包 libstdc++-8-dev:amd64。准备解压 .../01-libstdc++-8-dev_8.3.0.10-deepin1_amd64.deb  ...正在解压 libstdc++-8-dev:amd64 (8.3.0.10-deepin1) .../var/cache/apt/archives/libstdc++-8-dev_8.3.0.10-deepin1_amd64.deb正在选中未选择的软件包 g++-8。准备解压 .../02-g++-8_8.3.0.10-deepin1_amd64.deb  ...正在解压 g++-8 (8.3.0.10-deepin1) .../var/cache/apt/archives/g++-8_8.3.0.10-deepin1_amd64.deb正在选中未选择的软件包 g++。准备解压 .../03-g++_4%3a8.3.0-1_amd64.deb  ...正在解压 g++ (4:8.3.0-1) .../var/cache/apt/archives/g++_4%3a8.3.0-1_amd64.deb正在选中未选择的软件包 build-essential。准备解压 .../04-build-essential_12.6_amd64.deb  ...正在解压 build-essential (12.6) .../var/cache/apt/archives/build-essential_12.6_amd64.deb正在选中未选择的软件包 libbz2-dev:amd64。准备解压 .../05-libbz2-dev_1.0.6.2-deepin2_amd64.deb  ...正在解压 libbz2-dev:amd64 (1.0.6.2-deepin2) .../var/cache/apt/archives/libbz2-dev_1.0.6.2-deepin2_amd64.deb正在选中未选择的软件包 libexpat1-dev:amd64。准备解压 .../06-libexpat1-dev_2.2.6.5-deepin1_amd64.deb  ...正在解压 libexpat1-dev:amd64 (2.2.6.5-deepin1) .../var/cache/apt/archives/libexpat1-dev_2.2.6.5-deepin1_amd64.deb正在选中未选择的软件包 libffi-dev:amd64。准备解压 .../07-libffi-dev_3.2.1.2-1+dde_amd64.deb  ...正在解压 libffi-dev:amd64 (3.2.1.2-1+dde) .../var/cache/apt/archives/libffi-dev_3.2.1.2-1+dde_amd64.deb正在选中未选择的软件包 zlib1g-dev:amd64。准备解压 .../08-zlib1g-dev_1%3a1.2.12.5-1+dde_amd64.deb  ...正在解压 zlib1g-dev:amd64 (1:1.2.12.5-1+dde) .../var/cache/apt/archives/zlib1g-dev_1%3a1.2.12.5-1+dde_amd64.deb正在选中未选择的软件包 libpng-dev:amd64。准备解压 .../09-libpng-dev_1.6.36.2-2+dde_amd64.deb  ...正在解压 libpng-dev:amd64 (1.6.36.2-2+dde) .../var/cache/apt/archives/libpng-dev_1.6.36.2-2+dde_amd64.deb正在选中未选择的软件包 libfreetype6-dev:amd64。准备解压 .../10-libfreetype6-dev_2.9.1.2-1-deepin1_amd64.deb  ...正在解压 libfreetype6-dev:amd64 (2.9.1.2-1-deepin1) .../var/cache/apt/archives/libfreetype6-dev_2.9.1.2-1-deepin1_amd64.deb正在选中未选择的软件包 uuid-dev:amd64。准备解压 .../11-uuid-dev_2.33.1.19-1+dde_amd64.deb  ...正在解压 uuid-dev:amd64 (2.33.1.19-1+dde) .../var/cache/apt/archives/uuid-dev_2.33.1.19-1+dde_amd64.deb正在选中未选择的软件包 libfontconfig1-dev:amd64。准备解压 .../12-libfontconfig1-dev_2.13.1.1-2_amd64.deb  ...正在解压 libfontconfig1-dev:amd64 (2.13.1.1-2) .../var/cache/apt/archives/libfontconfig1-dev_2.13.1.1-2_amd64.deb正在选中未选择的软件包 libgpg-error-dev。准备解压 .../13-libgpg-error-dev_1.35.3-1+dde_amd64.deb  ...正在解压 libgpg-error-dev (1.35.3-1+dde) .../var/cache/apt/archives/libgpg-error-dev_1.35.3-1+dde_amd64.deb正在选中未选择的软件包 libgcrypt20-dev。准备解压 .../14-libgcrypt20-dev_1.8.4.2-1+dde_amd64.deb  ...正在解压 libgcrypt20-dev (1.8.4.2-1+dde) .../var/cache/apt/archives/libgcrypt20-dev_1.8.4.2-1+dde_amd64.deb正在选中未选择的软件包 libgmp-dev:amd64。准备解压 .../15-libgmp-dev_2%3a6.1.2.2-1+dde_amd64.deb  ...正在解压 libgmp-dev:amd64 (2:6.1.2.2-1+dde) .../var/cache/apt/archives/libgmp-dev_2%3a6.1.2.2-1+dde_amd64.deb正在选中未选择的软件包 libidn2-dev:amd64。准备解压 .../16-libidn2-dev_2.0.5.1-1+dde_amd64.deb  ...正在解压 libidn2-dev:amd64 (2.0.5.1-1+dde) .../var/cache/apt/archives/libidn2-dev_2.0.5.1-1+dde_amd64.deb正在选中未选择的软件包 libp11-kit-dev:amd64。准备解压 .../17-libp11-kit-dev_0.23.15.3-1+dde_amd64.deb  ...正在解压 libp11-kit-dev:amd64 (0.23.15.3-1+dde) .../var/cache/apt/archives/libp11-kit-dev_0.23.15.3-1+dde_amd64.deb正在选中未选择的软件包 libtasn1-6-dev:amd64。准备解压 .../18-libtasn1-6-dev_4.13.1-deepin1_amd64.deb  ...正在解压 libtasn1-6-dev:amd64 (4.13.1-deepin1) .../var/cache/apt/archives/libtasn1-6-dev_4.13.1-deepin1_amd64.deb正在选中未选择的软件包 nettle-dev:amd64。准备解压 .../19-nettle-dev_3.4.1.2-1_amd64.deb  ...正在解压 nettle-dev:amd64 (3.4.1.2-1) .../var/cache/apt/archives/nettle-dev_3.4.1.2-1_amd64.deb正在选中未选择的软件包 libgnutls28-dev:amd64。准备解压 .../20-libgnutls28-dev_3.6.7.8-deepin1_amd64.deb  ...正在解压 libgnutls28-dev:amd64 (3.6.7.8-deepin1) .../var/cache/apt/archives/libgnutls28-dev_3.6.7.8-deepin1_amd64.deb正在选中未选择的软件包 xorg-sgml-doctools。准备解压 .../21-xorg-sgml-doctools_1%3a1.11-1_all.deb  ...正在解压 xorg-sgml-doctools (1:1.11-1) .../var/cache/apt/archives/xorg-sgml-doctools_1%3a1.11-1_all.deb正在选中未选择的软件包 x11proto-dev。准备解压 .../22-x11proto-dev_2018.4-4_all.deb  ...正在解压 x11proto-dev (2018.4-4) .../var/cache/apt/archives/x11proto-dev_2018.4-4_all.deb正在选中未选择的软件包 x11proto-core-dev。准备解压 .../23-x11proto-core-dev_2018.4-4_all.deb  ...正在解压 x11proto-core-dev (2018.4-4) .../var/cache/apt/archives/x11proto-core-dev_2018.4-4_all.deb正在选中未选择的软件包 libice-dev:amd64。准备解压 .../24-libice-dev_2%3a1.0.9-2_amd64.deb  ...正在解压 libice-dev:amd64 (2:1.0.9-2) .../var/cache/apt/archives/libice-dev_2%3a1.0.9-2_amd64.deb正在选中未选择的软件包 libicu-dev:amd64。准备解压 .../25-libicu-dev_63.1.3-1+dde_amd64.deb  ...正在解压 libicu-dev:amd64 (63.1.3-1+dde) .../var/cache/apt/archives/libicu-dev_63.1.3-1+dde_amd64.deb正在选中未选择的软件包 liblzma-dev:amd64。准备解压 .../26-liblzma-dev_5.2.4.1-1+dde_amd64.deb  ...正在解压 liblzma-dev:amd64 (5.2.4.1-1+dde) .../var/cache/apt/archives/liblzma-dev_5.2.4.1-1+dde_amd64.deb正在选中未选择的软件包 libncurses-dev:amd64。准备解压 .../27-libncurses-dev_6.1.3-deepin1_amd64.deb  ...正在解压 libncurses-dev:amd64 (6.1.3-deepin1) .../var/cache/apt/archives/libncurses-dev_6.1.3-deepin1_amd64.debsignature verify success!正在选中未选择的软件包 libncurses5-dev:amd64。准备解压 .../28-libncurses5-dev_6.1.3-deepin1_amd64.deb  ...正在解压 libncurses5-dev:amd64 (6.1.3-deepin1) .../var/cache/apt/archives/libncurses5-dev_6.1.3-deepin1_amd64.debsignature verify success!正在选中未选择的软件包 libnspr4-dev。准备解压 .../29-libnspr4-dev_2%3a4.20.1-1+dde_amd64.deb  ...正在解压 libnspr4-dev (2:4.20.1-1+dde) .../var/cache/apt/archives/libnspr4-dev_2%3a4.20.1-1+dde_amd64.deb正在选中未选择的软件包 libnss3-dev:amd64。准备解压 .../30-libnss3-dev_2%3a3.42.1.8-1+deepin1_amd64.deb  ...正在解压 libnss3-dev:amd64 (2:3.42.1.8-1+deepin1) .../var/cache/apt/archives/libnss3-dev_2%3a3.42.1.8-1+deepin1_amd64.deb正在选中未选择的软件包 libpthread-stubs0-dev:amd64。准备解压 .../31-libpthread-stubs0-dev_0.4-1_amd64.deb  ...正在解压 libpthread-stubs0-dev:amd64 (0.4-1) .../var/cache/apt/archives/libpthread-stubs0-dev_0.4-1_amd64.deb正在选中未选择的软件包 libreadline-dev:amd64。准备解压 .../32-libreadline-dev_7.0-5_amd64.deb  ...正在解压 libreadline-dev:amd64 (7.0-5) .../var/cache/apt/archives/libreadline-dev_7.0-5_amd64.deb正在选中未选择的软件包 libsm-dev:amd64。准备解压 .../33-libsm-dev_2%3a1.2.3-1_amd64.deb  ...正在解压 libsm-dev:amd64 (2:1.2.3-1) .../var/cache/apt/archives/libsm-dev_2%3a1.2.3-1_amd64.deb正在选中未选择的软件包 libsqlite3-dev:amd64。准备解压 .../34-libsqlite3-dev_3.39.3-1_amd64.deb  ...正在解压 libsqlite3-dev:amd64 (3.39.3-1) .../var/cache/apt/archives/libsqlite3-dev_3.39.3-1_amd64.deb正在选中未选择的软件包 libtk8.6:amd64。准备解压 .../35-libtk8.6_8.6.9-2_amd64.deb  ...正在解压 libtk8.6:amd64 (8.6.9-2) .../var/cache/apt/archives/libtk8.6_8.6.9-2_amd64.deb正在选中未选择的软件包 libxau-dev:amd64。准备解压 .../36-libxau-dev_1%3a1.0.8.1-1+rebuild_amd64.deb  ...正在解压 libxau-dev:amd64 (1:1.0.8.1-1+rebuild) .../var/cache/apt/archives/libxau-dev_1%3a1.0.8.1-1+rebuild_amd64.deb正在选中未选择的软件包 libxdmcp-dev:amd64。准备解压 .../37-libxdmcp-dev_1%3a1.1.2-3_amd64.deb  ...正在解压 libxdmcp-dev:amd64 (1:1.1.2-3) .../var/cache/apt/archives/libxdmcp-dev_1%3a1.1.2-3_amd64.deb正在选中未选择的软件包 xtrans-dev。准备解压 .../38-xtrans-dev_1.3.5-1_all.deb  ...正在解压 xtrans-dev (1.3.5-1) .../var/cache/apt/archives/xtrans-dev_1.3.5-1_all.deb正在选中未选择的软件包 libxcb1-dev:amd64。准备解压 .../39-libxcb1-dev_1.13.1-2_amd64.deb  ...正在解压 libxcb1-dev:amd64 (1.13.1-2) .../var/cache/apt/archives/libxcb1-dev_1.13.1-2_amd64.deb正在选中未选择的软件包 libx11-dev:amd64。准备解压 .../40-libx11-dev_2%3a1.6.12.4-deepin1_amd64.deb  ...正在解压 libx11-dev:amd64 (2:1.6.12.4-deepin1) .../var/cache/apt/archives/libx11-dev_2%3a1.6.12.4-deepin1_amd64.debsignature verify success!正在选中未选择的软件包 x11proto-xext-dev。准备解压 .../41-x11proto-xext-dev_2018.4-4_all.deb  ...正在解压 x11proto-xext-dev (2018.4-4) .../var/cache/apt/archives/x11proto-xext-dev_2018.4-4_all.deb正在选中未选择的软件包 libxext-dev:amd64。准备解压 .../42-libxext-dev_2%3a1.3.3.1-1+rebuild_amd64.deb  ...正在解压 libxext-dev:amd64 (2:1.3.3.1-1+rebuild) .../var/cache/apt/archives/libxext-dev_2%3a1.3.3.1-1+rebuild_amd64.deb正在选中未选择的软件包 libxrender-dev:amd64。准备解压 .../43-libxrender-dev_1%3a0.9.10-1_amd64.deb  ...正在解压 libxrender-dev:amd64 (1:0.9.10-1) .../var/cache/apt/archives/libxrender-dev_1%3a0.9.10-1_amd64.deb正在选中未选择的软件包 libxft-dev:amd64。准备解压 .../44-libxft-dev_2.3.2-2_amd64.deb  ...正在解压 libxft-dev:amd64 (2.3.2-2) .../var/cache/apt/archives/libxft-dev_2.3.2-2_amd64.deb正在选中未选择的软件包 libxml2-dev:amd64。准备解压 .../45-libxml2-dev_2.9.4.6.3-deepin1_amd64.deb  ...正在解压 libxml2-dev:amd64 (2.9.4.6.3-deepin1) .../var/cache/apt/archives/libxml2-dev_2.9.4.6.3-deepin1_amd64.deb正在选中未选择的软件包 libxmlsec1-gcrypt:amd64。准备解压 .../46-libxmlsec1-gcrypt_1.2.27-2_amd64.deb  ...正在解压 libxmlsec1-gcrypt:amd64 (1.2.27-2) .../var/cache/apt/archives/libxmlsec1-gcrypt_1.2.27-2_amd64.deb正在选中未选择的软件包 libxmlsec1-gnutls:amd64。准备解压 .../47-libxmlsec1-gnutls_1.2.27-2_amd64.deb  ...正在解压 libxmlsec1-gnutls:amd64 (1.2.27-2) .../var/cache/apt/archives/libxmlsec1-gnutls_1.2.27-2_amd64.deb正在选中未选择的软件包 libxmlsec1-nss:amd64。准备解压 .../48-libxmlsec1-nss_1.2.27-2_amd64.deb  ...正在解压 libxmlsec1-nss:amd64 (1.2.27-2) .../var/cache/apt/archives/libxmlsec1-nss_1.2.27-2_amd64.deb正在选中未选择的软件包 libxslt1-dev:amd64。准备解压 .../49-libxslt1-dev_1.1.32.5-deepin1_amd64.deb  ...正在解压 libxslt1-dev:amd64 (1.1.32.5-deepin1) .../var/cache/apt/archives/libxslt1-dev_1.1.32.5-deepin1_amd64.deb正在选中未选择的软件包 libxmlsec1-dev。准备解压 .../50-libxmlsec1-dev_1.2.27-2_amd64.deb  ...正在解压 libxmlsec1-dev (1.2.27-2) .../var/cache/apt/archives/libxmlsec1-dev_1.2.27-2_amd64.deb正在选中未选择的软件包 x11proto-scrnsaver-dev。准备解压 .../51-x11proto-scrnsaver-dev_2018.4-4_all.deb  ...正在解压 x11proto-scrnsaver-dev (2018.4-4) .../var/cache/apt/archives/x11proto-scrnsaver-dev_2018.4-4_all.deb正在选中未选择的软件包 libxss-dev:amd64。准备解压 .../52-libxss-dev_1%3a1.2.3-1_amd64.deb  ...正在解压 libxss-dev:amd64 (1:1.2.3-1) .../var/cache/apt/archives/libxss-dev_1%3a1.2.3-1_amd64.deb正在选中未选择的软件包 libxt-dev:amd64。准备解压 .../53-libxt-dev_1%3a1.1.5.1.1-1+dde_amd64.deb  ...正在解压 libxt-dev:amd64 (1:1.1.5.1.1-1+dde) .../var/cache/apt/archives/libxt-dev_1%3a1.1.5.1.1-1+dde_amd64.deb正在选中未选择的软件包 llvm-7-runtime。准备解压 .../54-llvm-7-runtime_1%3a7.0.1-8_amd64.deb  ...正在解压 llvm-7-runtime (1:7.0.1-8) .../var/cache/apt/archives/llvm-7-runtime_1%3a7.0.1-8_amd64.deb正在选中未选择的软件包 llvm-runtime。准备解压 .../55-llvm-runtime_1%3a7.0-47_amd64.deb  ...正在解压 llvm-runtime (1:7.0-47) .../var/cache/apt/archives/llvm-runtime_1%3a7.0-47_amd64.deb正在选中未选择的软件包 llvm-7。准备解压 .../56-llvm-7_1%3a7.0.1-8_amd64.deb  ...正在解压 llvm-7 (1:7.0.1-8) .../var/cache/apt/archives/llvm-7_1%3a7.0.1-8_amd64.deb正在选中未选择的软件包 llvm。准备解压 .../57-llvm_1%3a7.0-47_amd64.deb  ...正在解压 llvm (1:7.0-47) .../var/cache/apt/archives/llvm_1%3a7.0-47_amd64.deb正在选中未选择的软件包 tcl。准备解压 .../58-tcl_8.6.9+1_amd64.deb  ...正在解压 tcl (8.6.9+1) .../var/cache/apt/archives/tcl_8.6.9+1_amd64.deb正在选中未选择的软件包 tcl8.6-dev:amd64。准备解压 .../59-tcl8.6-dev_8.6.9.1-deepin1_amd64.deb  ...正在解压 tcl8.6-dev:amd64 (8.6.9.1-deepin1) .../var/cache/apt/archives/tcl8.6-dev_8.6.9.1-deepin1_amd64.deb正在选中未选择的软件包 tcl-dev:amd64。准备解压 .../60-tcl-dev_8.6.9+1_amd64.deb  ...正在解压 tcl-dev:amd64 (8.6.9+1) .../var/cache/apt/archives/tcl-dev_8.6.9+1_amd64.deb正在选中未选择的软件包 tk8.6。准备解压 .../61-tk8.6_8.6.9-2_amd64.deb  ...正在解压 tk8.6 (8.6.9-2) .../var/cache/apt/archives/tk8.6_8.6.9-2_amd64.deb正在选中未选择的软件包 tk。准备解压 .../62-tk_8.6.9+1_amd64.deb  ...正在解压 tk (8.6.9+1) .../var/cache/apt/archives/tk_8.6.9+1_amd64.deb正在选中未选择的软件包 tk8.6-dev:amd64。准备解压 .../63-tk8.6-dev_8.6.9-2_amd64.deb  ...正在解压 tk8.6-dev:amd64 (8.6.9-2) .../var/cache/apt/archives/tk8.6-dev_8.6.9-2_amd64.deb正在选中未选择的软件包 tk-dev:amd64。准备解压 .../64-tk-dev_8.6.9+1_amd64.deb  ...正在解压 tk-dev:amd64 (8.6.9+1) .../var/cache/apt/archives/tk-dev_8.6.9+1_amd64.deb正在设置 libnspr4-dev (2:4.20.1-1+dde) ...正在设置 libncurses-dev:amd64 (6.1.3-deepin1) ...正在设置 libgmp-dev:amd64 (2:6.1.2.2-1+dde) ...正在设置 nettle-dev:amd64 (3.4.1.2-1) ...正在设置 libtk8.6:amd64 (8.6.9-2) ...正在设置 libreadline-dev:amd64 (7.0-5) ...正在设置 libffi-dev:amd64 (3.2.1.2-1+dde) ...正在设置 libpthread-stubs0-dev:amd64 (0.4-1) ...正在设置 xtrans-dev (1.3.5-1) ...正在设置 libexpat1-dev:amd64 (2.2.6.5-deepin1) ...正在设置 libsqlite3-dev:amd64 (3.39.3-1) ...正在设置 libgpg-error-dev (1.35.3-1+dde) ...正在设置 uuid-dev:amd64 (2.33.1.19-1+dde) ...正在设置 libxmlsec1-gcrypt:amd64 (1.2.27-2) ...正在设置 binfmt-support (2.2.0-2) ...Created symlink /etc/systemd/system/multi-user.target.wants/binfmt-support.service → /lib/systemd/system/binfmt-support.service.正在设置 libidn2-dev:amd64 (2.0.5.1-1+dde) ...正在设置 liblzma-dev:amd64 (5.2.4.1-1+dde) ...正在设置 libxmlsec1-nss:amd64 (1.2.27-2) ...正在设置 zlib1g-dev:amd64 (1:1.2.12.5-1+dde) ...正在设置 libnss3-dev:amd64 (2:3.42.1.8-1+deepin1) ...正在设置 tcl (8.6.9+1) ...正在设置 libncurses5-dev:amd64 (6.1.3-deepin1) ...正在设置 xorg-sgml-doctools (1:1.11-1) ...正在设置 libxmlsec1-gnutls:amd64 (1.2.27-2) ...正在设置 libtasn1-6-dev:amd64 (4.13.1-deepin1) ...正在设置 libicu-dev:amd64 (63.1.3-1+dde) ...正在设置 libp11-kit-dev:amd64 (0.23.15.3-1+dde) ...正在设置 libstdc++-8-dev:amd64 (8.3.0.10-deepin1) ...正在设置 libbz2-dev:amd64 (1.0.6.2-deepin2) ...正在设置 libgnutls28-dev:amd64 (3.6.7.8-deepin1) ...正在设置 x11proto-dev (2018.4-4) ...正在设置 tk8.6 (8.6.9-2) ...正在设置 libxau-dev:amd64 (1:1.0.8.1-1+rebuild) ...正在设置 llvm-7-runtime (1:7.0.1-8) ...正在设置 llvm-7 (1:7.0.1-8) ...正在设置 libice-dev:amd64 (2:1.0.9-2) ...正在设置 libsm-dev:amd64 (2:1.2.3-1) ...正在设置 tcl8.6-dev:amd64 (8.6.9.1-deepin1) ...正在设置 libpng-dev:amd64 (1.6.36.2-2+dde) ...正在设置 libfreetype6-dev:amd64 (2.9.1.2-1-deepin1) ...正在设置 libxdmcp-dev:amd64 (1:1.1.2-3) ...正在设置 libxml2-dev:amd64 (2.9.4.6.3-deepin1) ...正在设置 libgcrypt20-dev (1.8.4.2-1+dde) ...正在设置 x11proto-core-dev (2018.4-4) ...正在设置 llvm-runtime (1:7.0-47) ...正在设置 llvm (1:7.0-47) ...正在设置 tcl-dev:amd64 (8.6.9+1) ...正在设置 x11proto-xext-dev (2018.4-4) ...正在设置 g++-8 (8.3.0.10-deepin1) ...正在设置 tk (8.6.9+1) ...正在设置 x11proto-scrnsaver-dev (2018.4-4) ...正在设置 libfontconfig1-dev:amd64 (2.13.1.1-2) ...正在设置 libxcb1-dev:amd64 (1.13.1-2) ...正在设置 libxslt1-dev:amd64 (1.1.32.5-deepin1) ...正在设置 libx11-dev:amd64 (2:1.6.12.4-deepin1) ...正在设置 libxt-dev:amd64 (1:1.1.5.1.1-1+dde) ...正在设置 libxext-dev:amd64 (2:1.3.3.1-1+rebuild) ...正在设置 g++ (4:8.3.0-1) ...update-alternatives: 使用 /usr/bin/g++ 来在自动模式中提供 /usr/bin/c++ (c++)正在设置 libxmlsec1-dev (1.2.27-2) ...正在设置 build-essential (12.6) ...正在设置 libxrender-dev:amd64 (1:0.9.10-1) ...正在设置 libxft-dev:amd64 (2.3.2-2) ...正在设置 libxss-dev:amd64 (1:1.2.3-1) ...正在设置 tk8.6-dev:amd64 (8.6.9-2) ...正在设置 tk-dev:amd64 (8.6.9+1) ...正在处理用于 systemd (241.52-deepin1) 的触发器 ...正在处理用于 man-db (2.8.5-2) 的触发器 ...正在处理用于 libc-bin (2.28.23-deepin1) 的触发器 ...pdsyw@pdsyw-PC:~/Desktop$ 

4、下载pyenv.run

5、安装pyenv

pdsyw@pdsyw-PC:~/Desktop$ ls -ltr总用量 36-rw-r--r-- 1 pdsyw pdsyw 6777 10月 28 11:48 dde-computer.desktop-rw-r--r-- 1 pdsyw pdsyw  623 10月 28 11:48 deepin-tooltips.desktop-rw-r--r-- 1 pdsyw pdsyw 5235 10月 28 11:48 dde-trash.desktop-rw-r--r-- 1 pdsyw pdsyw 3618 10月 28 11:48 dde-home.desktop-rw------- 1 pdsyw pdsyw    0 10月 28 12:51 hello.txt-rw-r--r-- 1 pdsyw pdsyw 7687 11月  3 23:04 org.kde.krfb.desktop-rw-r--r-- 1 pdsyw pdsyw  270 11月 27 17:06 pyenv.runpdsyw@pdsyw-PC:~/Desktop$ sudo bash pyenv.run pyenv: Git is not installed, can't continue.pdsyw@pdsyw-PC:~/Desktop$ 

6、安装git

pdsyw@pdsyw-PC:~/Desktop$ sudo apt install git正在读取软件包列表... 完成正在分析软件包的依赖关系树       正在读取状态信息... 完成       下列软件包是自动安装的并且现在不需要了:  libutempter0 squashfs-tools x11-apps x11-session-utils xbitmaps xinit使用'sudo apt autoremove'来卸载它(它们)。将会同时安装下列软件:  git-man liberror-perl建议安装:  git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs  git-mediawiki git-svn下列【新】软件包将被安装:  git git-man liberror-perl升级了 0 个软件包,新安装了 3 个软件包,要卸载 0 个软件包,有 28 个软件包未被升级。需要下载 7,024 kB 的归档。解压缩后会消耗 37.0 MB 的额外空间。您希望继续执行吗? [Y/n] y获取:1  eagle/main amd64 liberror-perl all 0.17027-2 [30.9 kB]获取:2  eagle/main amd64 git-man all 1:2.20.1.3-2+dde [1,621 kB]获取:3  eagle/main amd64 git amd64 1:2.20.1.3-2+dde [5,372 kB]已下载 7,024 kB,耗时 1秒 (7,214 kB/s)正在选中未选择的软件包 liberror-perl。(正在读取数据库 ... 系统当前共安装有 206438 个文件和目录。)准备解压 .../liberror-perl_0.17027-2_all.deb  ...正在解压 liberror-perl (0.17027-2) .../var/cache/apt/archives/liberror-perl_0.17027-2_all.deb正在选中未选择的软件包 git-man。准备解压 .../git-man_1%3a2.20.1.3-2+dde_all.deb  ...正在解压 git-man (1:2.20.1.3-2+dde) .../var/cache/apt/archives/git-man_1%3a2.20.1.3-2+dde_all.deb正在选中未选择的软件包 git。准备解压 .../git_1%3a2.20.1.3-2+dde_amd64.deb  ...正在解压 git (1:2.20.1.3-2+dde) .../var/cache/apt/archives/git_1%3a2.20.1.3-2+dde_amd64.deb正在设置 liberror-perl (0.17027-2) ...正在设置 git-man (1:2.20.1.3-2+dde) ...正在设置 git (1:2.20.1.3-2+dde) ...正在处理用于 man-db (2.8.5-2) 的触发器 ...pdsyw@pdsyw-PC:~/Desktop$ 

7、安装pyenv

pdsyw@pdsyw-PC:~/Desktop$ bash pyenv.run 正克隆到 '/home/pdsyw/.pyenv'...remote: Enumerating objects: 1182, done.remote: Counting objects: 100% (1182/1182), done.remote: Compressing objects: 100% (671/671), done.remote: Total 1182 (delta 692), reused 658 (delta 378), pack-reused 0接收对象中: 100% (1182/1182), 587.79 KiB | 824.00 KiB/s, 完成.处理 delta 中: 100% (692/692), 完成.正克隆到 '/home/pdsyw/.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 5 (delta 0), pack-reused 0展开对象中: 100% (11/11), 完成.正克隆到 '/home/pdsyw/.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 5 (delta 0), pack-reused 0展开对象中: 100% (10/10), 完成.正克隆到 '/home/pdsyw/.pyenv/plugins/pyenv-virtualenv'...remote: Enumerating objects: 63, done.remote: Counting objects: 100% (63/63), done.remote: Compressing objects: 100% (56/56), done.remote: Total 63 (delta 11), reused 29 (delta 0), pack-reused 0展开对象中: 100% (63/63), 完成.WARNING: seems you still have not added 'pyenv' to the load path.# Load pyenv automatically by appending# the following to # ~/.bash_profile if it exists, otherwise ~/.profile (for login shells)# and ~/.bashrc (for interactive shells) :export PYENV_ROOT="$HOME/.pyenv"[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"eval "$(pyenv init -)"# Restart your shell for the changes to take effect.# Load pyenv-virtualenv automatically by adding# the following to ~/.bashrc:eval "$(pyenv virtualenv-init -)"pdsyw@pdsyw-PC:~/Desktop$

8、pyenv初始化脚本添加到shell配置文件中

pdsyw@pdsyw-PC:~/Desktop$ echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrcpdsyw@pdsyw-PC:~/Desktop$ pdsyw@pdsyw-PC:~/Desktop$ echo 'eval "$(pyenv init --path)"' >> ~/.bashrcpdsyw@pdsyw-PC:~/Desktop$ pdsyw@pdsyw-PC:~/Desktop$ source ~/.bashrcpdsyw@pdsyw-PC:~/Desktop$ 

9、安装特定版本的Python-3.9.1

pdsyw@pdsyw-PC:~/Desktop$ pyenv install 3.9.1Downloading Python-3.9.1.tar.xz...->  Python-3.9.1...patching file Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rstpatching file configurepatching file configure.acInstalled Python-3.9.1 to /home/pdsyw/.pyenv/versions/3.9.1pdsyw@pdsyw-PC:~/Desktop$ pyenv global 3.9.1pdsyw@pdsyw-PC:~/Desktop$ 

10、验证安装

pdsyw@pdsyw-PC:~/Desktop$ python --versionPython 3.9.1pdsyw@pdsyw-PC:~/Desktop$ pdsyw@pdsyw-PC:~/Desktop$ python3 --versionPython 3.9.1pdsyw@pdsyw-PC:~/Desktop$ 

11、安装特定版本的Python-3.8.1

pdsyw@pdsyw-PC:~/Desktop$ pyenv install 3.8.1Downloading Python-3.8.1.tar.xz...->  Python-3.8.1...Installed Python-3.8.1 to /home/pdsyw/.pyenv/versions/3.8.1pdsyw@pdsyw-PC:~/Desktop$ pdsyw@pdsyw-PC:~/Desktop$ pyenv global 3.8.1pdsyw@pdsyw-PC:~/Desktop$ 

12、切换查看python版本

pdsyw@pdsyw-PC:~/Desktop$ python3 --versionPython 3.8.1pdsyw@pdsyw-PC:~/Desktop$ pdsyw@pdsyw-PC:~/Desktop$ python --versionPython 3.8.1pdsyw@pdsyw-PC:~/Desktop$ pdsyw@pdsyw-PC:~/Desktop$ pyenv global 3.9.1pdsyw@pdsyw-PC:~/Desktop$ pdsyw@pdsyw-PC:~/Desktop$ python --versionPython 3.9.1pdsyw@pdsyw-PC:~/Desktop$ python3 --versionPython 3.9.1pdsyw@pdsyw-PC:~/Desktop$ 

标签: #python372下载安装教程