python3 installation tutorial

Time:2023-10-14

Preface: It is recommended to use version 3.6 and above, the system comes with python2 do not uninstall, some system commands to use, 2 and 3 can coexist!

I. Linux installation of python3 (Python-3.6.8)

1. Check to see if python3 is installed.

python3 -V

2. Download the installation package

1、Download via wget command

wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz

2、Directly into the Python website to download the installation package, uploaded to the

https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz

3. Extract the installation package to the specified directory, and rename the files

# Unzip
tar -zxvf Python-3.6.8.tgz -C /usr/local/
# Rename
mv Python-3.6.8/ python3

4. Installation of dependencies

yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make

Install the dependencies needed by python. On success (Complete!)
If python is version 3.7, you also need to install libffi-devel

5. Compile and install

./configure --prefix=/usr/local/Python3
make 
make install

Here -prefix=/usr/local/Python3 is the installation directory of Python, be sure to change it, otherwise there will be no bin file in the installation directory of Python.

6. Create a soft link between Python3 and pip3

Ln -s/usr/local/Python3 / bin/python3.6 / usr/bin/Python3 # Python3 soft links 
Ln -s/usr/local/Python3 / bin/pip3.6 / usr/bin/pip3 # pip3 soft links 
Note: If the soft link was created incorrectly, it can be removed by the following statement 
1. ln -s /usr/local/Python3/bin/pip3.8 /usr/bin/pip3 # soft link = address + soft link name 
2. rm -r /usr/bin/pip3 # /usr/bin/pip3 for the soft link name

7. Check availability

python3 --version
pip3 --version

Installation completed

Second, Windows installation of python3 (Python-3.6.8)

1.Download

1. AccessPythonOfficial website home page, click Downloads, select Windows, select the corresponding version to download
python3 installation tutorial
python3 installation tutorial

2. Installation

Once downloaded, the installation process is the same as a normal installation of Windows software, double-click to install.
1. Select Custom Installation and check Configure Python environment variables.python3 installation tutorial
2. Select the installation path
python3 installation tutorial
3. Successful installation
python3 installation tutorial
5. Command Line Verification
python3 installation tutorial
If execution of python -V prompts for a command that is not internal or external to —-, configure the following environment variables

3. Configure environment variables

Go to Settings-About-Advanced System Settings
python3 installation tutorial
Click on Environment Variables
python3 installation tutorial
Find the selection path editor
python3 installation tutorial
Insert the Python installation path and Python’s Scripts path (depending on your installation)
D:\Python\Python36\Scripts
D:\Python\Python36
python3 installation tutorial
Command Line Verification
python3 installation tutorial
End of installation!

Recommended Today

uniapp and applet set tabBar and show and hide tabBar

(1) Set the tabBar: uni.setTabberItem({}); wx.setTabberItem({}); indexnumberisWhich item of the tabBar, counting from the left, is indexed from 0.textstringnoButton text on tabiconPathstringnoImage PathselectedIconPathstringnoImage path when selectedpagePathstringnoPage absolute pathvisiblebooleannotab Whether to display uni.setTabBarItem({ index: 0, text: ‘text’, iconPath: ‘/path/to/iconPath’, selectedIconPath: ‘/path/to/selectedIconPath’, pagePath: ‘pages/home/home’ }) wx.setTabBarItem({ index: 0, text: ‘text’, iconPath: ‘/path/to/iconPath’, selectedIconPath: ‘/path/to/selectedIconPath’, pagePath: ‘pages/home/home’ }) […]