Install Python3 on a Mac

本文详细介绍了在Mac上安装Python3的步骤,包括安装Xcode、使用Homebrew包管理器以及设置PATH环境变量,帮助读者顺利配置Python3开发环境。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Prerequisites for installing Python3 on Mac Install Xcode Xcode is Apple's Integrated Development Environment (IDE). You might already have Xcode on your Mac. If not, you can get Xcode from Apple appstore.

Xcode Install Brew Homebrew installs the stuff you need. Homebrew is a package manager for Mac OS

Step 1. Launch Terminal.

Go to Launchpad – Other – Terminal

Step 2. Install HomeBrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Python3 with Brew Enter brew command into terminal

brew install python3 Optional, PATH environment Set up PATH environment variable, if you used HomeBrew to install Python3, then HomeBrew already added PATH.

Do not change PATH environment if you can launch python3 from terminal.

Add the following line to your ~/.profile file

export PATH=/usr/local/bin:/usr/local/sbin:$PATH Usually your Python installation directory looks like this, add it to your PATH

PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"

转载于:https://my.oschina.net/u/1177171/blog/2963829

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值