• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# hb安装异常
2
3
4## hb安装过程中出现乱码、段错误
5
6- **现象描述**
7  执行“python3 -m pip install --user ohos-build”出现乱码、段错误(segmentation fault)。
8
9- **可能原因**
10  pip版本过低。
11
12- **解决办法**
13  执行如下命令升级pip。
14
15
16  ```
17  python3 -m pip install -U pip
18  ```
19
20
21## hb安装过程中提示"cannot import 'sysconfig' from 'distutils'"
22
23- **现象描述**
24  执行“python3 -m pip install --user ohos-build”提示"cannot import 'sysconfig' from 'distutils'"
25
26- **可能原因**
27  缺少distutils模块。
28
29- **解决办法**
30  执行如下命令安装。
31
32
33  ```
34  sudo apt-get install python3.8-distutils
35  ```
36
37
38## hb安装过程中提示"module 'platform' has no attribute 'linux_distribution'"
39
40- **现象描述**
41  执行“python3 -m pip install --user ohos-build”提示"module 'platform' has no attribute 'linux_distribution'"
42
43- **可能原因**
44  python3 pip安装兼容性问题。
45
46- **解决办法**
47  执行如下命令重新安装pip。
48
49
50  ```
51  sudo apt remove python3-pip
52  curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
53  python get-pip.py
54  ```
55
56
57## hb安装过程中提示"Could not find a version that satisfies the requirement ohos-build"
58
59- **现象描述**
60  执行“python3 -m pip install --user ohos-build”提示"Could not find a version that satisfies the requirement ohos-build"
61
62- **可能原因**
63  可能是网络环境较差导致的安装失败。
64
65- **解决办法**
66  1. 请检查网络连接是否正常。如果网络有问题,请修复网络问题后重新安装。
67  2. 若网络正常,请尝试指定临时pypi源的方式安装:
68
69      ```
70      python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ohos-build
71      ```
72