Mac 电脑基础环境配置

配置账号

MAC启用 root 用户 https://jingyan.baidu.com/article/c910274b5c58a1cd361d2dc4.html

允许通过 ssh 登录 root 账号:https://blog.csdn.net/KimBing/article/details/82761986


brew

安装 brew:

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

brew 更换源

# 替换brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

# 替换homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

# 刷新源
brew update

reference:https://www.jianshu.com/p/bea984d27cd2


Git

url:https://git-scm.com/download/mac

Homebrew

Install homebrew if you don’t already have it, then:
$ brew install git

MacPorts

Install MacPorts if you don’t already have it, then:
$ sudo port install git

Xcode

Apple ships a binary package of Git with Xcode.

Building from Source

If you prefer to build from source, you can find tarballs on kernel.org. The latest version is 2.35.1.

Installing git-gui

If you would like to install git-gui and gitk, git’s commit GUI and interactive history browser, you can do so using homebrew
$ brew install git-gui


Java

url:https://repo.huaweicloud.com/java/jdk/11+28/

带界面的 mac 中,双击安装 dmg 文件,下一步。

验证:java -version


Python

安装 Python3.9,并配置环境变量设置为默认:https://www.python.org/downloads/

也可以用 brew 来安装,不过可能会因为网络问题而报错

brew install python@3.9

安装 virtualenv:

pip3 install virtualenv

软连接一下,作为环境变量,直接使用

find / -name virtualenv  # 查看 virtualenv 位置
ln -s /Library/Frameworks/Python.framework/Versions/3.9/bin/virtualenv  /usr/local/bin/virtualenv

创建一个虚拟环境:

virtualenv -p /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9  my_env_folder

Xcode

方式1:AppStore 安装 Xcode

方式2:安装指定版本的 Xcode:

在 Mac 机上打开 https://developer.apple.com/download/all,比如搜索 Xcode 9.2

安装包默认存放在 Downloads 目录下,直接双击安装,安装后的 Xcode.app 应用程序也是在 Downloads 目录下,最好将其移动到 Applications 目录下。

reference:低版本 Mac OS 安装合适的 Xcode


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值