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 [email protected]

安装 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


猜你喜欢

转载自blog.csdn.net/qq_31362767/article/details/125319684