• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Environment Setup<a name="EN-US_TOPIC_0000001215650793"></a>
2
3
4## Mini and Small Systems<a name="section1742119306399"></a>
5
6### What should I do if garbled characters and segmentation faults occur during hb installation?<a name="section36351051193919"></a>
7
8-   **Symptom**
9
10    Garbled characters and segmentation faults occur during the execution of the  **python3 -m pip install --user ohos-build**  command.
11
12
13-   **Possible Causes**
14
15    pip is of an early version.
16
17-   **Solutions**
18
19    Upgrade pip.
20
21    ```
22    python3 -m pip install -U pip
23    ```
24
25
26### What should I do if the message "cannot import 'sysconfig' from 'distutils'" is displayed during hb installation?<a name="section48221013144011"></a>
27
28-   **Symptom**
29
30    The message "cannot import 'sysconfig' from 'distutils'" is displayed during the execution of the  **python3 -m pip install --user ohos-build**  command.
31
32
33-   **Possible Causes**
34
35    The  **distutils**  module is unavailable.
36
37-   **Solutions**
38
39    Install  **distutils**.
40
41    ```
42    sudo apt-get install python3.8-distutils
43    ```
44
45
46### What should I do if the message "module 'platform' has no attribute 'linux\_distribution'" is displayed during hb installation?<a name="section10307193044111"></a>
47
48-   **Symptom**
49
50    The message "module 'platform' has no attribute 'linux\_distribution'" is displayed during the execution of the  **python3 -m pip install --user ohos-build**  command.
51
52
53-   **Possible Causes**
54
55    There is a compatibility issue of python3-pip.
56
57-   **Solutions**
58
59    Reinstall pip.
60
61    ```
62    sudo apt remove python3-pip
63    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
64    python get-pip.py
65    ```
66
67
68### What should I do if the message "Could not find a version that satisfies the requirement ohos-build" is displayed during hb installation?<a name="section8692735427"></a>
69
70-   **Symptom**
71
72    The message "Could not find a version that satisfies the requirement ohos-build" is displayed during the execution of the  **python3 -m pip install --user ohos-build**  command.
73
74
75-   **Possible Causes**
76
77    The installation fails due to poor network connectivity.
78
79-   **Solutions**
80    1.  Ensure that your computer has a good network connection. If the network connection is unstable, rectify the network fault and reinstall hb.
81    2.  If the network is functional, run the following commands to install hb by specifying a temporary PyPI source:
82
83        ```
84        python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ohos-build
85        ```
86
87
88
89### What should I do when the message  **configure: error: no acceptable C compiler found in $PATH**  is displayed during Python 3 installation?<a name="section870082884217"></a>
90
91-   **Symptom**
92
93    The following error occurs during Python 3 installation:
94
95    ```
96    configure: error: no acceptable C compiler found in $PATH. See 'config.log' for more details
97    ```
98
99-   **Possible Causes**
100
101    **GCC**  is not installed.
102
103-   **Solutions**
104
105    1. Run the  **apt-get install gcc**  command to install  **GCC**  online.
106
107    2. After the installation, reinstall Python 3.
108
109
110### What should I do when the message  **-bash: make: command not found**  is displayed during Python 3 installation?<a name="section198707170455"></a>
111
112-   **Symptom**
113
114    The following error occurs during Python 3 installation:
115
116    ```
117    -bash: make: command not found
118    ```
119
120-   **Possible Causes**
121
122    **Make**  is not installed.
123
124-   **Solutions**
125
126    1. Run the  **apt-get install make**  command to install  **Make**  online.
127
128    2. After the installation, reinstall Python 3.
129
130
131### What should I do when the message  **zlib not available**  is displayed during Python 3 installation?<a name="section85401445204518"></a>
132
133-   **Symptom**
134
135    The following error occurs during Python 3 installation:
136
137    ```
138    zipimport.ZipImportError: can't decompress data; zlib not available
139    ```
140
141-   **Possible Causes**
142
143    **zlib**  is not installed.
144
145-   **Solutions**
146
147    Solution 1: Run the  **apt-get install zlib**  command to install  **zlib**  online.
148
149    Solution 2: If the software source does not contain  **zlib**, download the source code from  https://www.zlib.net/.
150
151    ![](figures/download-zlib.png)
152
153    Then run the following commands to install  **zlib**  offline:
154
155    ```
156    # tar xvf zlib-1.2.11.tar.gz
157    # cd zlib-1.2.11
158    # ./configure
159    # make && make install
160    ```
161
162    After the installation, reinstall Python 3.
163
164
165### What should I do when the message  **No module named '\_ctypes'**  is displayed during Python 3 installation?<a name="section12202694460"></a>
166
167-   **Symptom**
168
169    The following error occurs during Python 3 installation:
170
171    ```
172    ModuleNotFoundError: No module named '_ctypes'
173    ```
174
175
176-   **Possible Causes**
177
178    **libffi**  and  **libffi-devel**  are not installed.
179
180
181-   **Solutions**
182
183    1. Run the  **apt-get install libffi\* -y**  command to install  **libffi**  and  **libffi-devel**  online.
184
185    2. After the installation, reinstall Python 3.
186
187
188### What should I do when an error with  **lsb\_release**  occurs during  **kconfiglib**  installation?<a name="section5803174135115"></a>
189
190-   **Symptom**
191
192    The following error occurs during  **kconfiglib**  installation:
193
194    ```
195    subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.
196    ```
197
198-   **Possible Causes**
199
200    The Python version matched with the  **lsb\_release**  module is different from the current Python version.
201
202-   **Solutions**
203
204    Run the  **find / -name lsb\_release**  command, for example,  **sudo rm -rf /usr/bin/lsb\_release**  to locate and delete  **lsb\_release**.
205
206
207### What should I do if the message "ImportError: No module named apt\_pkg" is displayed during the execution of an unidentifiable command?<a name="section510820516515"></a>
208
209-   **Symptom**
210
211    The message "ImportError: No module named apt\_pkg" is displayed when an unidentifiable command is executed on the Linux server.
212
213
214-   **Possible Causes**
215
216    There is a compatibility issue of python3-apt.
217
218-   **Solutions**
219
220    Reinstall python3-apt.
221
222    ```
223    sudo apt-get remove  python3-apt
224    sudo apt-get install python3-apt
225    ```
226
227
228