本篇针对统计本人在配置各种环境中常见的错误,并持续进行更新。
错误求解过程部分为网上索引,部分为本人底层处理,因此不一定适用于所有人。
还希望大家可以针对问题,提供不同的解决方法,本人一定会虚心学习,并更好的完善该文章!
-------------------------------------------------------------------------------------------------------------------
1. No module named 'pycocotools'
解决:
# 由于需要编译C,所以要安装下面这个包
pip install -U cpython
# 然后直接pip安装就好
pip install pycocotools
2. AttributeError: module 'distutils' has no attribute 'version'
# 这是由于版本过高导致的,本人使用下面的版本可以正常工作
pip install setuptools==59.5.0
3. AttributeError: module 'numpy' has no attribute 'bool'.
# 这是由于版本过高导致的,本人使用下面的版本可以正常工作
pip install numpy==1.23.1
4. AttributeError: module 'openai' has no attribute 'error'
# 这是由于版本过高导致的,本人使用下面的版本可以正常工作
pip install openai==0.28.1
5. ImportError: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory
# 这个问题 暂时不知道为什么要安装这些包,根据网上抄来的
sudo apt update
sudo apt install ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6
6. ModuleNotFoundError: No module named 'meshplot'
# 这个包使用pip安装不了,或者出现错误,所以使用conda安装
conda install -c conda-forge meshplot
7. libXrender.so.1: cannot open shared object file: No such file or directory
sudo apt-get update
sudo apt-get install libxrender1
8. ImportError: libSM.so.6: cannot open shared object file: No such file or directory
sudo apt-get update
sudo apt-get install libsm6
9. ImportError: libGL.so.1: cannot open shared object file: No such file or directory
sudo apt-get update
sudo apt-get update
sudo apt-get install ffmpeg libsm6 libxext6 -y
10. libXi.so.6: cannot open shared object file: No such file or directory
sudo apt-get update
sudo apt-get install libxi6 libgconf-2-4
11. Error: libxkbcommon-x11.so.0: cannot open shared object file
sudo apt update
sudo apt install libxkbcommon-x11-0
12. subprocess.CalledProcessError: Command ‘[‘ninja‘, ‘-v‘]‘ returned non-zero exit status 1
# 打开对应的setup.py文件
cmdclass={'build_ext': BuildExtension}
# 改成 ↓
cmdclass={'build_ext': BuildExtension.with_options(use_ninja=False)}
13. fatal error: boost/geometry.hpp: No such file or director
sudo apt-get install libboost-filesystem-dev
sudo apt-get install libboost-dev
14. 7z: command not found
sudo apt-get update
sudo apt-get install p7zip-full p7zip-rar
"""
建议安装 p7zip-full 包(不是 p7zip),因为这是最完全的 7zip 程序包,
它支持很多归档格式。此外,如果您想处理 RAR 文件话,
还需要安装 p7zip-rar 包,做成一个独立的插件包的原因是因为 RAR 是一种专有格式。
"""
15. Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.
pip install opencv-python-headless==4.5.3.56