How to install pyenv under Linux

How to install pyenv under Linux

Prerequisites

Need to install git

Installation Steps

1. Clone pyenv from the remote repository

Clone pyenv using the command below:

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

2. Configure environment variables

Use the following three commands in sequence to configure the environment variables:

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile

Or go directly into the file and add at the end:

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

3. Using environment variables

Use the source command to re-execute the configuration file modified in the previous step:

source ~/.bash_profile

At this point, pyenv is installed.

You can use the following command to view the installed pyenv version:

[root@server1 local]# pyenv -v
pyenv 1.2.13-14-gecd67c8

Summarize

The above is the method of installing pyenv under Linux introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Ubuntu 18.04 installs pyenv, pyenv-virtualenv, virtualenv, Numpy, SciPy, Pillow, Matplotlib
  • Install pyenv and virtualenv to manage multiple versions and projects of Python
  • Steps to install Pyenv under Deepin
  • Tutorial on installation and use of pyenv in Mac

<<:  Vue3 draggable left and right panel split component implementation

>>:  Detailed installation and uninstallation tutorial for MySQL 8.0.12

Recommend

How to use Xtrabackup to back up and restore MySQL

Table of contents 1. Backup 1.1 Fully prepared 1....

Vue uses Amap to realize city positioning

This article shares the specific code of Vue usin...

Summary of practical methods for JS beginners to process arrays

join() method: connects all elements in an array ...

Implementation process of nginx high availability cluster

This article mainly introduces the implementation...

How to build a private Docker repository using Harbor

Table of contents 1. Open source warehouse manage...

Mobile terminal adaptation makes px automatically converted to rem

Install postcss-pxtorem first: npm install postcs...

Detailed steps to install MySQL 5.6 X64 version under Linux

environment: 1. CentOS6.5 X64 2.mysql-5.6.34-linu...

HTML Code Writing Guide

Common Convention Tags Self-closing tags, no need...

Vue folding display multi-line text component implementation code

Folding display multi-line text component Fold an...

Detailed explanation of MySQL user and permission management

This article uses examples to describe the manage...

How to use js to determine whether a file is utf-8 encoded

Conventional solution Use FileReader to read the ...

MySQL performance optimization: how to use indexes efficiently and correctly

Practice is the only way to test the truth. This ...

Implementation of mysql decimal data type conversion

Recently, I encountered a database with the follo...

Writing daily automatic backup of MySQL database using mysqldump in Centos7

1. Requirements: Database backup is particularly ...