This article will introduce you to how to download and install Python locally.
Python can be used on multiple platforms including Linux and windows.
You can enter the "python" command through the terminal window to check whether Python has been installed locally and the installation version of Python.
Python download
Python’s latest source code, binary documents, news information, etc. can be viewed on Python’s official website:
Python official website: https:/ /www.python.org/
You can download Python documentation at the following link. You can download documentation in HTML, PDF, PostScript and other formats.
Python document download address: https://www.python.org/doc/
Installing Python on Unix & Linux platforms (Take Ubuntu as an example)
Step one: Install the dependent environment
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl
Step two: Download the Python3 installation package
wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz
Or go to the official python website to download it yourself: https://www.python.org /downloads/source/
Step 3: Create the installation directory
My personal habit is to install it in /usr/local/python3 (the specific installation location depends on personal preference)
mkdir -p /usr/local/python3
Step 4: Unzip the installation package
tar -zxvf Python-3.7.2.tgz
Step 5: Enter the decompressed directory, compile and install (you need to install the compiler sudo apt install gcc before compiling and installing)
(1) Enter after decompression Directory
(2) Execute ./configure
./configure --prefix=/usr/local/python3 #/usr/local/python3为安装目录
After executing the configure command, a Makefile will be generated. This Makefile is mainly used by the next make command. used (Linux needs to build (build) program components in the order specified by the Makefile).
(3) Execute the make command
make
make actually compiles the source code and generates an executable file.
(4) Execute the make install command again
make install
make install actually copies the generated execution file to the directory /usr/local/python3 specified by the previous configure command.
The installation has ended here, the following is the configuration environment.
Step 6: Create a soft link for python3
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
Step 7: Add /usr/local/python3/bin to PATH
sudo vim /etc/profile
Then add # at the end of the file ##
export PATH=$PATH:/usr/local/python3/binPress ESC, enter: wq and press Enter to exit. After modification, you need to make this environment variable take effect in the configuration information. Execute the command:
source /etc/profileto make the profile file take effect immediately. Step 8: Test whether the installation is successful
$ python3 -V Python 3.7.2$ pip3 -V pip 18.1 from /usr/local/python3/lib/python3.7/site-packages/pip (python 3.7)If the output is as above, it proves that the installation has been successful! If pip3 -V cannot be found, you can try to create a soft link to pip3:
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
Installing Python on Window platform
The following is for Window Simple steps to install Python on the platform: Open the WEB browser and visit https://www.python.org/downloads/windows/Select the Window platform installation package in the download list. The format is: python-XYZ.msi file, XYZ is the version number you want to install. After downloading, double-click the download package to enter the Python installation wizard. The installation is very simple. You only need to use the default settings and click "Next" until the installation is completed. Related video recommendation "Python video tutorial"
The above is the detailed content of How to download python and install it. For more information, please follow other related articles on the PHP Chinese website!

在 Python 安装后遭遇严重错误并无法卸载时,可采取以下步骤:使用第三方卸载工具(如 Revo Uninstaller)高级卸载。手动删除 Python 文件和文件夹,以及注册表项和环境变量。重启计算机,使更改生效。从官方网站重新安装与系统架构匹配的最新 Python 版本。

标题:如何解决PyCharm无法打开的问题PyCharm是一款功能强大的Python集成开发环境,但有时候我们可能会遇到无法打开PyCharm的问题。在本文中,我们将分享一些常见的解决方法,并提供具体的代码示例。希望能帮助到遇到这个问题的小伙伴们。方法一:清除缓存有时候PyCharm的缓存文件可能会导致程序无法正常打开,我们可以尝试清除缓存来解决这个问题。具

Scipy库安装指南及常见错误解决办法引言:Scipy是一个Python科学计算的开源库,提供了丰富的数学、科学和工程计算功能。它建立在NumPy库的基础之上,能够处理一些复杂的数值计算问题。本文将介绍Scipy的安装指南,并提供一些常见的错误解决办法,并配有具体的代码示例,帮助读者更好地理解和使用Scipy。一、Scipy库的安装指南安装Python和pi

Numpy安装攻略:一文解决安装难题,需要具体代码示例引言:Numpy是Python中一款强大的科学计算库,它提供了高效的多维数组对象和对数组数据进行操作的工具。但是,对于初学者来说,安装Numpy可能会带来一些困扰。本文将为大家提供一份Numpy安装攻略,以帮助大家快速解决安装难题。一、安装Python环境:在安装Numpy之前,首先需要确保已经安装了Py

PyQt5安装教程:从下载到配置引言:PyQt5是一款开源的PythonGUI(图形用户界面)框架,提供了丰富的界面控件和强大的功能,使开发者能够轻松创建高效、具有吸引力的图形用户界面。本文将详细讲解PyQt5的安装过程,并通过具体的代码示例帮助读者更好地理解。第一步:下载首先,我们需要下载PyQt5的安装文件。PyQt5官方网站为我们提供了Windows

Python 安装软件包错误的解决方法:确保模块已安装且安装路径正确。使用管理员权限安装软件包。卸载当前版本并重新安装指定正确版本的软件包。找到并卸载或重命名具有冲突名称的软件包。检查网络连接,禁用防火墙或使用 --trusted-host 参数。确认软件包名称拼写正确或检查安装源包含性。安装缺少的依赖关系。确保软件包已正确安装在 Python 路径中。

从零开始:Python安装Flask的完整指南引言Flask是一种轻量级的Pythonweb框架,被广泛应用于开发简单而又灵活的Web应用程序。本文将为您提供一个完整的指南,教您如何从零开始安装Flask,并且提供一些常用的代码示例。安装Python首先,您需要安装Python。您可以从Python官方网站(https://www.python.org)下

小白也能轻松上手:PyQT安装教程详解PyQT是一款基于Python语言的GUI开发工具包,它可以帮助开发者快速、简单地创建各种美观的图形用户界面。对于想要从零开始学习PyQT的初学者来说,安装PyQT可能是一个比较困难的第一步。本文将详细介绍PyQT的安装步骤,并提供具体的代码示例,帮助小白轻松上手。第一步:安装Python在安装PyQT之前,首先需要确保


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools
