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
When using nginx as a reverse proxy, you can simp...
Table of contents 1. Introduction to Linux system...
In the process of learning CSS3, I found that man...
HTML5 and jQuery implement the preview of local i...
When installing the centos7 version, choose to co...
1. First, let’s have a general introduction to th...
When a running container is terminated, how can w...
First, let me introduce the meaning of some field...
MySQL database tables can create, view, rebuild a...
Controversy over nofollow There was a dispute bet...
I don't know if you have ever encountered suc...
introduce This chapter mainly introduces the proc...
Let's make a simple 3D Rubik's Cube today...
You may have set a MySQL password just now, but f...
Table of contents 1. Location Object 1. URL 2. Pr...