harmony(鸿蒙)Fixing Compilation Issues
Fixing Compilation Issues
What should I do if the message “ImportError: No module named apt_pkg” is displayed during the execution of an unidentifiable command?
- Symptom
The message “ImportError: No module named apt_pkg” is displayed when an unidentifiable command is executed on the Linux server.
- Possible Causes
There is a compatibility issue of python3-apt.
- Solution
Reinstall python3-apt.
sudo apt-get remove python3-apt
sudo apt-get install python3-apt
What should I do if the message indicating Python cannot be found is displayed during compilation and building?
- Symptom
The following error occurs during compilation and building:
-bash: /usr/bin/python: No such file or directory
- Possible Cause 1
Python is not installed.
- Solution
Run the following command to install Python. The following uses Python 3.8 as an example.
sudo apt-get install python3.8
- Possible Cause 2
The soft link that points to the Python does not exist in the usr/bin directory.
- Solution
Run the following commands to add a soft link:
# cd /usr/bin/
# which python3
# ln -s /usr/local/bin/python3 python
# python --version
Example:
What should I do if the message indicating Python 3 cannot be found is displayed during the build process?
- Symptom
- Possible Causes
Python 3 is not installed.
- Solution
Run the following command to install Python 3:
sudo apt-get install python3.8
What should I do if the message “configure: error: no acceptable C compiler found in $PATH” is displayed during Python 3 installation?
- Symptom
The following error occurs during Python 3 installation:
configure: error: no acceptable C compiler found in $PATH. See 'config.log' for more details
- Possible Causes
gcc is not installed.
Solution
- Run the apt-get install gcc command to install gcc online.
- After the installation, reinstall Python 3.
What should I do if the message “-bash: make: command not found” is displayed during Python 3 installation?
- Symptom
The following error occurs during Python 3 installation:
-bash: make: command not found
- Possible Causes
Make is not installed.
Solution
- Run the apt-get install make command to install Make online.
- After the installation, reinstall Python 3.
What should I do if the message “No module named ‘_ctypes’” is displayed during Python 3 installation?
- Symptom
The following error occurs during Python 3 installation:
ModuleNotFoundError: No module named '_ctypes'
- Possible Causes
libffi and libffi-devel are not installed.
Solution
- Run the apt-get install libffi* -y command to install libffi and libffi-devel online.
- After the installation, reinstall Python 3.
What should I do if the message “No module named ‘Crypto’” is displayed during the build process?
- Symptom
The following error occurs during compilation and building:
ModuleNotFoundError: No module named 'Crypto'
- Possible Causes
Crypto is not installed.
- Solution
Solution 1: Run the pip3 install Crypto command to install Crypto online.
Method 2: Offline installation
Download the source code from PyPI.
Save the source package to the Linux server, decompress the package, and run the python3 setup.py install command to install Crypto.
After the preceding installation is complete, rebuild an environment.
你可能感兴趣的鸿蒙文章
harmony(鸿蒙)Overall Description of Compilation Form Factors
harmony(鸿蒙)Importing a Source Code Project
harmony(鸿蒙)Setting Up the Windows+Ubuntu Hybrid Development Environment
harmony(鸿蒙)Introduction to the Hi3516 Development Board
harmony(鸿蒙)Introduction to the Hi3861 Development Board
harmony(鸿蒙)Mini and Small System Overview
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦