代码拉取完成,页面将自动刷新
用户首次搭建 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"
可能是网络环境较差导致的安装失败。
- 请检查网络连接是否正常。如果网络有问题,请修复网络问题后重新安装。
- 若网络正常,请尝试指定临时pypi源的方式安装:
python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ohos-build==0.4.3
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。