Preface In the past, I always switched Python versions by modifying the soft link in the /bin/ directory, which was very inconvenient and it was also very cumbersome to install a new Python version. I tried pyenv and instantly felt that it was really good. I recorded the installation process notes. Install Install dependent libraries This step is required, otherwise the Python compiler will report a warning or exception, causing some extensions to be unusable, for example: WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib? WARNING: The Python readline extension was not compiled. Missing the GNU readline lib? ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? Installation command: # sudo apt install libssl-dev zlib1g-dev libbz2-dev \ libreadline-dev libsqlite3-dev libffi-dev \ libncurses5-dev libncursesw5-dev liblzma-dev Install pyenv download # git clone https://github.com/yyuu/pyenv.git ~/.pyenv Add the following to ~/.bashrc export PATH=~/.pyenv/bin:$PATH export PYENV_ROOT=~/.pyenv eval "$(pyenv init -)" Update environment variables # source ~/.bashrc Install Python # pyenv install 3.8.5 Downloading Python-3.8.5.tar.xz... -> https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tar.xz pyenv may download very slowly. You can copy the displayed download link, download it in the browser, and then put it in the ~/.pyenv/cache/ directory (the cache directory needs to be created manually), and then re-execute pyenv install 3.8.5 Switch Python environment Query the currently installed Python version # pyenv versions * system (set by /home/zpzhou/.pyenv/version) 3.8.5 Switch version You can use the command Before switching: # python -V Python 2.7.13 Switch: # pyenv global 3.8.5 After switching: # python -V Python 3.8.5 Summarize This is the end of this article about installing the artifact Pyenv under Deepin. For more information about installing the artifact Pyenv under Deepin, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Examples of correct use of interface and type methods in TypeScript
>>: Summary of several replication methods for MySQL master-slave replication
Web design is both a science and an art. Web desi...
This article introduces how to configure Nginx to...
Because the server's database hard disk space...
It's the end of the year and there are fewer ...
Table of contents Preface Instruction Basics Hook...
Table of contents Placeholder replacement Console...
1. Use the df command to view the overall disk us...
1. Favicon.cc To create ico icon websites online,...
margin:auto; + position: absolute; up, down, left...
Preface Now the operating system used by my compa...
How to install and configure mysql-5.7.5-m15-winx...
Preface: In MySQL, the CONCAT() function is used ...
async function and await keyword in JS function h...
In the past few years, I have been moving back an...
Table of contents Step 1: Log in as root user. St...