deepwzh的技术笔记
  • Golang
  • Python
  • Cpp
杂项
前端开发
  • 计算机网络
  • 操作系统
  • 数据库
云原生
Devops
AIGC
关于作者
  • Golang
  • Python
  • Cpp
杂项
前端开发
  • 计算机网络
  • 操作系统
  • 数据库
云原生
Devops
AIGC
关于作者
  • Python
  • 魔术方法
  • pep 草案
  • 内存管理
  • 学习资料

    • 学习资料
    • 进阶学习资料
  • Asyncio

    • Asyncio
    • 调度
  • 库

    • 库
    • 模板渲染相关
    • protobuf 相关
    • mysql 相关
  • cpython开发

    • cpython 开发
    • 开发环境搭建
    • CAPI
    • 提交流程
    • Pyrepl
  • 包与虚拟环境管理器

    • 包与虚拟环境管理器
    • Pip
    • Conda
    • Poetry
    • Pyenv
  • 科学计算相关

    • 科学计算相关
    • Pandas

开发环境搭建

使用 dev container

直接 wsl 拉取 cpython 源码,然后点 vscode 左下角,选择 Open In Container 即可

相关配置文件在.devcontainer/devcontainer.json

这样就不需要再额外装一些依赖了

额外需要安装的扩展

额外需要安装的软件

yum install procps bear

手动配置环境

也可以自行选择 ubuntu24.04 版本去用,缺啥装啥即可,以下主要讲的是手动安装步骤

编译安装

依赖工具

sudo apt-get install bear # 生成**compile_commands.json 用于代码提示**

安装

克隆 CPython 源码

git clone https://github.com/python/cpython

生成配置

cd cpython
./configure --config-cache --with-pydebug

生成 compile_commands.json

bear -- make -s -j `nproc`
Prev
cpython 开发
Next
CAPI