Mac配置开发环境

博主是一名Python后端开发,有时候环境太多 需要配置太多,故做此文章

环境Macbook ,请注意自己的是ARM 还是x86 结构

Vscode/Cursor配置Python debug

配置Debug

launch.json

python 复制代码
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: FastAPI",
            "type": "debugpy",
            "request": "launch",
            "module": "uvicorn",
            "args": [
                "app.main:app",
                "--host",
                "0.0.0.0",
                "--port",
                "8000",
                "--reload",
                "--log-level",
                "debug"
            ],
            "justMyCode": true,
            "env": {
                "PYTHONPATH": "${workspaceFolder}"
            }

        },
        {
            "name": "Python: Current File",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true,
            "env": {
                "PYTHONPATH": "${workspaceFolder}"
            }
        }
    ]
}

settings.json

python 复制代码
{
    "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
    "python.pythonPath": "${workspaceFolder}/.venv/bin/python",
    "python.analysis.extraPaths": [
        "${workspaceFolder}"
    ],
    "python.terminal.activateEnvironment": true,
    "[python]": {
        "editor.formatOnSave": false,
        "editor.defaultFormatter": null
    },
    "python.formatting.provider": "none",
    "editor.formatOnSave": false,
    "editor.rulers": [
        88
    ],
    "files.trimTrailingWhitespace": false,
    "files.insertFinalNewline": false,

}

插件使用

关于python的:

关于Git

Pycharm 配置网络

有时候网络不行

或者开启 TUN 模式

【终端模式】

Mac配置Github的ssh:

Mac使用homebrew安装git (相关下载直接AI

复制代码
新建一个ssh-keygen
ssh-keygen -t rsa -b 4096 -C "my_email@example.com"
# 后面邮箱写自己github账号邮箱

为方便多个公私钥的配置,请将文件名加以区分,例如:id_rsa_github.

下面的passphrase直接默认回车为空即可

这时候在默认路径下就生成了两个文件,公钥和私钥。

SSH Key添加到ssh-agent

复制代码
eval $(ssh-agent -s)
# 返回agent的Pid:

接着输入:

复制代码
ssh-add ~/.ssh/id_rsa (这个文件就是你之前改的路径名)

打开id_rsa_github.pub文件,复制文件内容到github (.pub是公钥,公钥放在平台上,私钥在自己手中,这里采用的算法是RSA非对称加密体制,即解密和加密的密钥是不同的)

进入自己的github个人主页,添加ssh key公钥,记得把id_rsa_github.pub文件内容全部复制过去,包括-----BEGIN OPENSSH PRIVATE KEY-----等。创建好即可。

复制代码
ssh -T git@github.com
[输入yes: 将The authenticity of host 'github.com (20.205.243.166)' can't be established.
这个是验证,出现以下信息即代表成功。
Hi xxx! You've successfully authenticated......

如果有代理,会出现22端口异常(挂代理的话访问github会很快)

处理方法如下:

https://docs.github.com/zh/authentication/troubleshooting-ssh/using-ssh-over-the-https-port

配置ITerm2 +Zsh

https://juejin.cn/post/6844904178075058189

下载

iTerm2

Oh My Zsh is an open source, community-driven framework for managing your zsh configuration.

python 复制代码
# via curl
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# via wget
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

vim ~/.zshrc

ZSH_THEME="agnoster"

软件部分

非必要不要下载 盗版软件!!!!

Webstorm 非商业版本

Pycharm 社区版

Sublime

Docker

Vscode/Cursor

Proxy-Tools

SourceTree( Github Desktop)

Todesk

IINA(播放器)

Charles (ProxyPin ,抓包工具,网络分析)

相关推荐
aosky19 小时前
手机远程畅玩OpenAI Codex
macos·智能手机·cocoa
A懿轩A1 天前
【2026 最新】Python 下载与安装:在 macOS 下使用 Homebrew 和 pyenv 完美管理多版本 Python
python·macos·mac
IKaros_α‌1 天前
mac上安装openclaw从入门到删除
macos
x-cmd1 天前
macOS 内存模型深度解析 | x free 设计哲学
linux·macos·内存·策略模式·free·x-cmd
itinymeng1 天前
在 macOS 上遇到 brew: command not found 错误,通常是因为 ‌Homebrew 未安装‌ 或 ‌PATH 环境变量未正确配置‌
macos
oscar9991 天前
Claude Code 的“计算机使用”功能:让命令行助手真正操控macOS桌面
macos·claude code·computer
老兵发新帖2 天前
软件开发国内常用镜像源配置及回退方法(MAC版)
macos·软件工程
qq_411262422 天前
ESP32-C5 软件配置MAC 地址
macos
鸠摩智首席音效师2 天前
如何在 MacOS 上安装 PostgreSQL ?
数据库·macos·postgresql
花千树-0102 天前
IndexTTS2 在 macOS 性能最佳设置(M1/M2/M3/M4 全适用)
人工智能·深度学习·macos·ai·语音识别·ai编程