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
If there are any errors in this article or you ha...
The development history of CSS will not be introd...
1. nohup Run the program in a way that ignores th...
Effect The effect diagram is as follows Implement...
Table of contents 1. What is the life cycle 2. Th...
Recently, I found that the company's server t...
The following error is reported when MySQL joins ...
Before we begin, we create two tables to demonstr...
1. Preliminary preparation (windows7+mysql-8.0.18...
1. Background I recently made a website, uidea, w...
This article mainly introduces the wonderful use ...
Find the problem I recently encountered a problem...
Preface scp is the abbreviation of secure copy. s...
webpack-dev-server core concepts Webpack's Co...
Table of contents 01-Event Bubbling 1.1- Introduc...