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