Linux 系统安装 pyenv 简明教程

推荐关注博主的微信公众号 Android安全工程,微信公众号围绕 Android 应用的安全防护和逆向分析为主要的两个点, 分享各种安全攻防手段、Hook 技术、ARM 汇编等 Android 相关的知识

前置条件

  • git
  • Kali 2022 / Ubuntu 16.04

安装步骤

1. 从远程仓库中克隆 pyenv

使用下面的命令克隆 pyenv:

git clone https://github.com/yyuu/pyenv.git ~/.pyenv

2. 配置环境变量

使用命令来配置环境变量:

sudo vim /etc/profile

在文本内添加以下属性:

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

3. 使用环境变量

使用 source 命令重新执行上一步中修改的配置文件:

source /etc/profile

至此,pyenv 就安装完成了。

可以使用下面的命令查看所安装的 pyenv 版本:

[root@server1 local]# pyenv -v
pyenv 2.3.2

4. 下载需要的Python版本

通过 list 命令查看可用的 Python 版本

pyenv install --list

结果如下:

Available versions:
  2.1.3
  2.2.3
  2.3.7
  2.4.0
  2.4.1
  ...
pyenv install 3.9.0

这时候下载可能会比较慢,pyenv 下载的缓冲目录为 ~/.pyenv/cache。切换到该目录,若没有 cache 则:

sudo mkdir cache
// 这里根据自己需要的下载链接替换
wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz 
pyenv install 3.9.0

在这里插入图片描述

查看安装的 Python 版本:

pyenv versions
// 显示:(*号表示当前使用的版本)
* system (set by /home/iroot/.pyenv/version)
  3.9.0

切换成自己需要的 Python 版本:

pyenv global 3.9.0
pyenv versions
// 显示:
  system
* 3.9.0 (set by /home/iroot/.pyenv/version)

以上,表示成功切换成自己需要的 Python 版本。

5. 查看帮助

pyenv help
// 显示:
Usage: pyenv <command> [<args>]

Some useful pyenv commands are:
   commands    List all available pyenv commands
   exec        Run an executable with the selected Python version
   global      Set or show the global Python version(s)
   help        Display help for a command
   hooks       List hook scripts for a given pyenv command
   init        Configure the shell environment for pyenv
   install     Install a Python version using python-build
   local       Set or show the local application-specific Python version(s)
   prefix      Display prefixes for Python versions
   rehash      Rehash pyenv shims (run this after installing executables)
   root        Display the root directory where versions and shims are kept
   shell       Set or show the shell-specific Python version
   shims       List existing pyenv shims
   uninstall   Uninstall a specific Python version
   --version   Display the version of pyenv
   version     Show the current Python version(s) and its origin
   version-file   Detect the file that sets the current pyenv version
   version-name   Show the current Python version
   version-origin   Explain how the current Python version is set
   versions    List all Python versions available to pyenv
   whence      List all Python versions that contain the given executable
   which       Display the full path to an executable

See `pyenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/pyenv/pyenv#readme
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
安装WiFi驱动程序可以让您在Linux系统上使用无线网络功能。下面是一个简单的Linux系统安装WiFi的教程: 1. 首先,确保您的Linux系统已经安装了所需的无线网卡驱动程序。您可以从官方网站或其他可信的资源下载适合您网卡型号和Linux系统版本的驱动程序。 2. 下载并安装必要的软件包。如果您使用的是Kali Linux系统,您可以通过命令行输入以下命令来安装所需的软件包:。 - 如果您更喜欢使用图形用户界面(GUI),您可以在Linux系统中寻找适合您的WiFi热点创建器。一些常用的WiFi热点创建器包括NetworkManager和Hostapd等。您可以通过在应用商店中搜索并安装相关软件包来使用它们。 5. 根据您选择的方式,按照相应的指导进行操作,创建您的WiFi热点。 请注意,具体的步骤可能因您使用的Linux发行版和无线网卡型号而有所不同。在进行安装和配置之前,建议您查阅相关的文档和参考资料,以确保正确地完成安装过程。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Kali Linux安装 WIFI无线网卡驱动 教程](https://blog.csdn.net/weixin_39576018/article/details/117044789)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [linux-wifi-hotspot:适用于Linux的功能丰富的wifi热点创建器,同时提供GUI和命令行界面。 它还能够使用已...](https://download.csdn.net/download/weixin_42112685/14999474)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值