# python_oh开源仓库 **Repository Path**: OpenHarmony_Python/python_oh ## Basic Information - **Project Name**: python_oh开源仓库 - **Description**: oh上原生使用python - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: 5.1.0_cpython_v3.8.10 - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-06-18 - **Last Updated**: 2025-07-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # cpython交叉编译集成到OpenHarmony中 ## 目前适配进展 将cpython 3.8.10 交叉编译并且集成到固件中,除python中设计图形的标准库不能使用外,其他标准库均可正常使用,pip可正常使用(仅纯python实现的pip库可正常使用,涉及到c/c++的pip库以闭源方式提供,请关注https://gitcode.com/ai_model_sig/ohos_pypi) ![alt text](pic/image.png) 下面以OpenHarmony5.1.0 rk3568为例集成python,其他设备请参考本仓库略加修改即可使用 ``` # 拉取5.1.0 非tag分支代码 mkdir OpenHarmony-5.1.0-Release && cd OpenHarmony-5.1.0-Release repo init -u https://gitee.com/openharmony/manifest -b OpenHarmony-5.1.0-Release --no-repo-verify repo sync -c repo forall -c 'git lfs pull' # 下载本仓库 git clone -b cpython_3.8.10 https://gitcode.com/ai_model_sig/ohos_python.git python_oh # 打 5.1.0 3568 python适配补丁 patch -p1 < python_oh/5.1.0_3568_add_python.patch # 编译3568固件 ./build.sh --product-name rk3568 --ccache ``` ## 单独编译 ``` # 32位 ./build.sh --product-name rk3568 --ccache --build-target=cpython # 64位 ./build.sh --product-name rk3568 --ccache --build-target=cpython --target-cpu arm64 ``` ## 安装pip ``` # 设置全局可读写 mount -o remount,rw / python3 -m ensurepip --upgrade ```