12 Star 9 Fork 0

wicom-ingenic / OpenHarmony

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
环境搭建.md 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
jsli 提交于 2022-07-08 18:13 . 更新目录结构

环境搭建

用户首次搭建 OpenHarmony 研发环境需参照本章节进行操作

# 需安装 Ubuntu 20.04

# 安装 Ubuntu 基础开发包
sudo apt update
sudo apt install -y binutils git git-lfs gnupg flex bison gperf build-essential \
                    zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
                    lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
                    libgl1-mesa-dev libxml2-utils xsltproc unzip m4 wget bc python python3.8 \
                    libssl-dev mtools default-jdk
# 注:python3 的版本是 python3.8,注意python3.9及以上版本可能会报错。

# 安装 repo 工具
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 | sudo tee /usr/local/bin/repo >/dev/null
sudo chmod a+x /usr/local/bin/repo

# 安装 hb 工具
python3 -m pip uninstall ohos-build
python3 -m pip install --user ohos-build==0.4.3
# 导入环境变量
echo "export PATH=~/.local/bin:$PATH" >> ~/.bashrc

# 设置 bash
sudo ln -sf bash /bin/sh

# 设置 git
git config --global user.name your_name
git config --global user.email your_email

常见问题

1.1 安装hb过程中,提示"Could not find a version that satisfies the requirement ohos-build"

  • 现象描述

    执行“python3 -m pip install --user ohos-build”提示"Could not find a version that satisfies the requirement ohos-build"

  • 可能原因

    可能是网络环境较差导致的安装失败。

  • 解决办法
    1. 请检查网络连接是否正常。如果网络有问题,请修复网络问题后重新安装。
    2. 若网络正常,请尝试指定临时pypi源的方式安装:
    python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ohos-build==0.4.3
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wicom-ingenic/openharmony.git
git@gitee.com:wicom-ingenic/openharmony.git
wicom-ingenic
openharmony
OpenHarmony
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891