apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev
root@kali:~# curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2454 100 2454 0 0 2405 0 0:00:01 0:00:01 --:--:-- 2405
正克隆到 '/root/.pyenv'...
remote: Enumerating objects: 670, done.
remote: Counting objects: 100% (670/670), done.
remote: Compressing objects: 100% (503/503), done.
remote: Total 670 (delta 335), reused 258 (delta 76), pack-reused 0
接收对象中: 100% (670/670), 381.77 KiB | 287.00 KiB/s, 完成.
处理 delta 中: 100% (335/335), 完成.
正克隆到 '/root/.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
展开对象中: 100% (11/11), 完成.
正克隆到 '/root/.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
展开对象中: 100% (16/16), 完成.
正克隆到 '/root/.pyenv/plugins/pyenv-update'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (6/6), done.
展开对象中: 100% (10/10), 完成.
remote: Total 10 (delta 1), reused 6 (delta 0), pack-reused 0
正克隆到 '/root/.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 21 (delta 0), pack-reused 0
展开对象中: 100% (57/57), 完成.
正克隆到 '/root/.pyenv/plugins/pyenv-which-ext'...
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
展开对象中: 100% (10/10), 完成.
WARNING: seems you still have not added 'pyenv' to the load path.
# Load pyenv automatically by adding
# the following to ~/.bashrc:
export PATH="/root/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
root@kali:~#
0x03写入配置文件
把以下内容写入 ~/.bashrc 并重启
export PATH="/root/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
[root@localhost ~]# pyenv versions
* system (set by /root/.pyenv/version)
0x04卸载pyenv
root@kali:~# rm -rf ~/.pyenv