Python installation interpreter


1. Download the Python interpreter

First, you need to download the Python interpreter from the official Python website (https://python.org). The current stable releases of Python are the 3.9.x series. Installers for different operating systems are available on the website. Choose the appropriate version according to your operating system.

2. Installation of Linux environment

The installation process of tar.gz and tar.xz is the same

tar xf Python-3.8.15.tar.xz -C /usr/local/src/
cd /usr/local/src/Python-3.8.15/
./configure --prefix=/apps/python38
make && make install
vim /etc/profile
....
PATH=$PATH:/apps/python38/bin
export PATH

source /etc/profile
root@test:~# python3.8
Python 3.8.15 (default, Nov  2 2022, 22:32:44) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
root@test:~# pip3 -V
pip 22.0.4 from /apps/python38/lib/python3.8/site-packages/pip (python 3.8)


3. pycharm create project

insert image description here

adjust font size

insert image description here

insert image description here

4. Verify that the installation is successful

No matter which operating system you are using, you can verify that Python installed successfully by opening a command line or terminal and entering the following command:

python --version

This will display the installed Python version number. If the version number is displayed, Python has been successfully installed.

There are some common problems you may encounter when installing the Python interpreter. Here are some common problems and how to fix them:

  1. PATH environment variable issue: If you did not select the "Add Python to PATH" option during installation, you will not be able to access Python directly from the command line or terminal. The workaround is to re-run the installer with that option selected.

  2. The installer cannot run: Some Windows systems may prevent unauthenticated installers from running. The workaround is to right click on the installer file and select "Run as Administrator".

  3. The installation process is slow or interrupted: This may be because your internet connection is unstable or the official Python servers are heavily loaded. The workaround is to wait a while and retry the installation when the network is stable.

Guess you like

Origin blog.csdn.net/weixin_45841831/article/details/131647929