mac系统安装Python3初体验
作者:童真的烂漫 时间:2023-11-27 07:33:16
前沿
对于iOS开发不要随便拆卸系统自带的Python,因为有很多 library 还是使用 Python2.7。
1 安装Xcode
1.1 App Store 搜索Xcode 并安装
1.2 安装 Xcode command line tool
1.2.1 打开命令行terminal工具
control + space
输入terminal
回车
1.2.2 安装Xcode command line tool
xcode-select --install
2 安装套件管理工具 Homebrew
2.1 安装 Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.2 查看是否安装成功
brew doctor
3 安装Python
brew install python
4 设置路径(可选)
如果不设置路径,则使用python的话,会默认用系统的。(这个没有具体执行,所以这个需要自己尝试)
## 修改/etc/paths,把/usr/local/bin 移到上面去
sudo vim /etc/paths
拓展:
查看当前path是什么。
PATH 的用途:
告诉系統,我们的brew在哪里。会从上往下查找。
echo $PAHTH
5 确认安装
// 系统自带的python2.7,目录为/usr/bin/python
which python
//brew安装的python3.4,目录为/usr/local/bin/python3
which python3
6 使用
未执行操作4的情况(推荐)
// 系统自带的
python a.py
//brew安装的
python3 a.py
执行操作4的情况
// 系统自带的
/usr/bin/python a.py
//brew安装的
python a.py
7 安装pip
安装Python2.7以上版本,会自动带pip。
系统自带的python没有pip,只有easy_install
// 给系统的python安装pip
easy_install pip
使用pip
// 系统自带的
pip --version
//brew安装的
pip3 --version
总结
以上所述是小编给大家介绍的mac系统安装Python3初体验网站的支持!
来源:http://blog.csdn.net/u010828718/article/details/70257622
标签:mac,python3
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python 如何让特征值滞后一行
2021-06-06 06:30:46
![](https://img.aspxhome.com/file/2023/4/65564_0s.jpg)
python常用时间库time、datetime与时间格式之间的转换教程
2023-05-03 01:24:37
![](https://img.aspxhome.com/file/2023/8/98958_0s.png)
thinkphp的URL路由规则与配置实例
2023-11-16 02:58:57
scrapy爬虫:scrapy.FormRequest中formdata参数详解
2022-10-02 10:28:38
![](https://img.aspxhome.com/file/2023/2/93632_0s.jpg)
sql2008评估期已过的解决办法及序列号
2024-01-13 10:32:11
在python 脚本下解析json数据
2022-05-28 10:38:20
![](https://img.aspxhome.com/file/2023/6/107046_0s.png)
在python3.5中使用OpenCV的实例讲解
2021-03-14 21:30:36
![](https://img.aspxhome.com/file/2023/9/128569_0s.jpg)
Python利用prettytable实现格式化输出内容
2023-10-17 11:02:32
![](https://img.aspxhome.com/file/2023/5/114505_0s.png)
关于CSS中字号控制的兼容性研究
2010-01-23 12:48:00
简化翻页提升可用性
2009-03-28 11:52:00
![](https://img.aspxhome.com/file/UploadPic/20093/28/wp_pagenavi_1_en-28s.png)
PyCharm如何导入python项目的方法
2022-10-23 05:50:35
![](https://img.aspxhome.com/file/2023/6/88926_0s.png)
解决python中文乱码问题方法总结
2022-01-30 18:47:56
“生活”设计
2009-03-03 12:14:00
![](https://img.aspxhome.com/file/UploadPic/20093/3/lifedesign_hole-89s.jpg)
如何使用PyTorch实现自由的数据读取
2022-06-16 12:28:16
![](https://img.aspxhome.com/file/2023/0/72120_0s.png)
windows系统mysql5.7.18安装图文教程
2024-01-26 04:40:59
![](https://img.aspxhome.com/file/2023/1/69141_0s.png)
Python使用内置json模块解析json格式数据的方法
2023-07-30 14:10:45
![](https://img.aspxhome.com/file/2023/6/61226_0s.png)
论坛首页效果图设计
2009-03-19 13:46:00
![](https://img.aspxhome.com/file/UploadPic/20093/19/newbbs-600x1523-48s.jpg)
python 判断txt每行内容中是否包含子串并重新写入保存的实例
2023-11-28 06:34:56
![](https://img.aspxhome.com/file/2023/2/80632_0s.jpg)
Design IT. (8),一匹“更快的马”
2009-02-11 12:19:00
Go语言开发发送Get和Post请求的示例
2024-05-21 10:23:46