search
HomeBackend DevelopmentPython TutorialHow to download python and install it
How to download python and install itMay 16, 2019 pm 02:42 PM
python installation

How to download python and install it

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/bin

Press 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/profile

to 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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
python安装发生严重错误,卸载不了怎么办python安装发生严重错误,卸载不了怎么办Apr 20, 2024 pm 10:13 PM

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

解决PyCharm无法打开的方法分享解决PyCharm无法打开的方法分享Feb 22, 2024 am 09:03 AM

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

安装和解决Scipy库常见错误指南安装和解决Scipy库常见错误指南Feb 18, 2024 am 10:53 AM

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

Numpy安装攻略:一文解决安装难题Numpy安装攻略:一文解决安装难题Feb 21, 2024 pm 08:15 PM

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

PyQt5安装教程:从下载到配置,详细讲解PyQt5的安装过程PyQt5安装教程:从下载到配置,详细讲解PyQt5的安装过程Feb 21, 2024 am 11:24 AM

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

python安装软件包错误怎么解决python安装软件包错误怎么解决Apr 20, 2024 pm 10:13 PM

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

零基础者如何安装Flask:Python完整安装指南零基础者如何安装Flask:Python完整安装指南Feb 19, 2024 pm 02:25 PM

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

初学者也能轻松掌握:PyQT安装指南详细解析初学者也能轻松掌握:PyQT安装指南详细解析Feb 18, 2024 pm 06:06 PM

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

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

mPDF

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 new version

SublimeText3 Linux latest version

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools