Home Backend Development Python Tutorial 各个系统下的Python解释器相关安装方法

各个系统下的Python解释器相关安装方法

Jun 10, 2016 pm 03:07 PM
python Install

Python下载
Python最新源码,二进制文档,新闻资讯等可以在Python的官网查看到:
Python官网:http://www.python.org/
你可以在一下链接中下载Python的文档,你可以下载 HTML、PDF 和 PostScript 等格式的文档。
Python文档下载地址:www.python.org/doc/

Python安装
Python已经被移植在许多平台上(经过改动使它能够工作在不同平台上)。
您需要下载适用于您使用平台的二进制代码,然后安装Python。
如果您平台的二进制代码是不可用的,你需要使用C编译器手动编译源代码。
编译的源代码,功能上有更多的选择性, 为python安装提供了更多的灵活性。
以下为不同平台上安装Python的方法:
Unix & Linux 平台安装 Python:
以下为在Unix & Linux 平台上安装 Python 的简单步骤:
打开WEB浏览器访问http://www.python.org/download/
选择适用于Unix/Linux的源码压缩包。
下载及解压压缩包。
如果你需要自定义一些选项修改Modules/Setup

  • 执行 ./configure 脚本
  • make
  • make install

执行以上操作后,Python会安装在 /usr/local/bin 目录中,Python库安装在/usr/local/lib/pythonXX,XX为你使用的Python的版本号。
Window 平台安装 Python:
以下为在 Window 平台上安装 Python 的简单步骤:
打开WEB浏览器访问http://www.python.org/download/
在下载列表中选择Window平台安装包,包格式为:python-XYZ.msi 文件 , XYZ 为你要安装的版本号。
要使用安装程序 python-XYZ.msi, Windows系统必须支持Microsoft Installer 2.0搭配使用。只要保存安装文件到本地计算机,然后运行它,看看你的机器支持MSI。Windows XP和更高版本已经有MSI,很多老机器也可以安装MSI。
下载后,双击下载包,进入Python安装向导,安装非常简单,你只需要使用默认的设置一直点击"下一步"直到安装完成即可。
MAC 平台安装 Python:
最近的Mac OS系统都自带有Python环境,但是自带的Python版本为旧版本,你可以通过链接http://www.python.org/download/mac/ 查看MAC上Python的新版功能介绍。
MAC上完整的Python安装教程你可以查看:http://homepages.cwi.nl/~jack/macpython/index.html

环境变量配置
程序和可执行文件可以在许多目录,而这些路径很可能不在操作系统提供可执行文件的搜索路径中。
path(路径)存储在环境变量中,这是由操作系统维护的一个命名的字符串。这些变量包含可用的命令行解释器和其他程序的信息。
Unix或Windows中路径变量为PATH(UNIX区分大小写,Windows不区分大小写)。
在Mac OS中,安装程序过程中改变了python的安装路径。如果你需要在其他目录引用Python,你必须在path中添加Python目录。
在 Unix/Linux 设置环境变量
在 csh shell: 输入

setenv PATH "$PATH:/usr/local/bin/python" 
Copy after login

, 按下"Enter"。
在 bash shell (Linux): 输入

export PATH="$PATH:/usr/local/bin/python" 
Copy after login

,按下"Enter"。
在 sh 或者 ksh shell: 输入

PATH="$PATH:/usr/local/bin/python"
Copy after login

, 按下"Enter"。
注意: /usr/local/bin/python 是Python的安装目录。
在 Windows 设置环境变量
在环境变量中添加Python目录:
在命令提示框中(cmd) : 输入

path %path%;C:\Python 
Copy after login

, 按下"Enter"。
注意: C:\Python 是Python的安装目录。

Statement of this Website
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

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1268
29
C# Tutorial
1248
24
PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

Choosing Between PHP and Python: A Guide Choosing Between PHP and Python: A Guide Apr 18, 2025 am 12:24 AM

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP and Python: A Deep Dive into Their History PHP and Python: A Deep Dive into Their History Apr 18, 2025 am 12:25 AM

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

How to run sublime code python How to run sublime code python Apr 16, 2025 am 08:48 AM

To run Python code in Sublime Text, you need to install the Python plug-in first, then create a .py file and write the code, and finally press Ctrl B to run the code, and the output will be displayed in the console.

Python vs. JavaScript: The Learning Curve and Ease of Use Python vs. JavaScript: The Learning Curve and Ease of Use Apr 16, 2025 am 12:12 AM

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

Golang vs. Python: Performance and Scalability Golang vs. Python: Performance and Scalability Apr 19, 2025 am 12:18 AM

Golang is better than Python in terms of performance and scalability. 1) Golang's compilation-type characteristics and efficient concurrency model make it perform well in high concurrency scenarios. 2) Python, as an interpreted language, executes slowly, but can optimize performance through tools such as Cython.

Where to write code in vscode Where to write code in vscode Apr 15, 2025 pm 09:54 PM

Writing code in Visual Studio Code (VSCode) is simple and easy to use. Just install VSCode, create a project, select a language, create a file, write code, save and run it. The advantages of VSCode include cross-platform, free and open source, powerful features, rich extensions, and lightweight and fast.

How to run python with notepad How to run python with notepad Apr 16, 2025 pm 07:33 PM

Running Python code in Notepad requires the Python executable and NppExec plug-in to be installed. After installing Python and adding PATH to it, configure the command "python" and the parameter "{CURRENT_DIRECTORY}{FILE_NAME}" in the NppExec plug-in to run Python code in Notepad through the shortcut key "F6".

See all articles