• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Fixing hb Installation Errors
2
3
4## Garbled characters and segmentation faults occur during hb installation
5
6- **Symptom**
7
8  During the execution of **python3 -m pip install --user ohos-build**, garbled characters and segmentation faults occur..
9
10- **Possible Causes**
11
12  The pip version does not meet requirements.
13
14- **Solution**
15
16  Run the following command to upgrade pip:
17
18
19  ```
20  python3 -m pip install -U pip
21  ```
22
23
24## "cannot import 'sysconfig' from 'distutils'" is displayed during hb installation
25
26- **Symptom**
27
28  During the execution of **python3 -m pip install --user ohos-build**, the following information is displayed:<br>cannot import 'sysconfig' from 'distutils'
29
30- **Possible Causes**
31
32  The **distutils** module is unavailable.
33
34- **Solution**
35
36  Run the following command to install **distutils**:
37
38
39  ```
40  sudo apt-get install python3.8-distutils
41  ```
42
43
44## "module 'platform' has no attribute 'linux_distribution'" is displayed during hb installation
45
46- **Symptom**
47
48  During the execution of **python3 -m pip install --user ohos-build**, the following information is displayed:<br>module 'platform' has no attribute 'linux_distribution'
49
50- **Possible Causes**
51
52  There is a compatibility issue of python3-pip.
53
54- **Solution**
55
56  Reinstall pip.
57
58
59  ```
60  sudo apt remove python3-pip
61  curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
62  python get-pip.py
63  ```
64
65
66## "Could not find a version that satisfies the requirement ohos-build" is displayed during hb installation
67
68- **Symptom**
69
70  During the execution of **python3 -m pip install --user ohos-build**, the following information is displayed:<br>Could not find a version that satisfies the requirement ohos-build
71
72- **Possible Causes**
73
74   The installation fails due to poor network connectivity.
75
76- **Solution**
77  1. Ensure that your computer has a good network connection. If the network connection is unstable, rectify the network fault and reinstall hb.
78  2. If the network is functional, run the following command to install hb by specifying a temporary PyPI source:
79
80      ```
81      python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ohos-build
82      ```
83