- Ubuntu环境
- ImportError: libXrender.so.1: cannot open shared object file
- AttributeError: module ‘cv2’ has no attribute ‘_registerMatType’
- OSError: cannot load library ‘libsndfile.so’
- [Errno 2] No usable temporary directory found in [‘/tmp’, ‘/var/tmp’, ‘/usr/tmp’, ‘/home/dgene/code/wav2lip’]
- pip install .whl 报错 zipfile.BadZipFile: File is not a zip file
- Win10 环境
Ubuntu环境
ImportError: libXrender.so.1: cannot open shared object file
报错信息
Traceback (most recent call last):
File "inference.py", line 3, in <module>
import scipy, cv2, os, sys, argparse, audio
File "/home/dgene/anaconda3/envs/wav2lip/lib/python3.6/site-packages/cv2/__init__.py", line 181, in <module>
bootstrap()
File "/home/dgene/anaconda3/envs/wav2lip/lib/python3.6/site-packages/cv2/__init__.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "/home/dgene/anaconda3/envs/wav2lip/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libXrender.so.1: cannot open shared object file: No such file or directory
解决:
sudo apt-get install libxrender1
AttributeError: module ‘cv2’ has no attribute ‘_registerMatType’
当前版本 opencv-contrib-python=4.6.0.66
版本要小于4.3!!
降为 opencv-contrib-python=4.2.0.34,解决。
OSError: cannot load library ‘libsndfile.so’
sudo apt install libsndfile1
[Errno 2] No usable temporary directory found in [‘/tmp’, ‘/var/tmp’, ‘/usr/tmp’, ‘/home/dgene/code/wav2lip’]
1、使用df -h命令查看磁盘使用率
2、使用命令du -sh * 当前目录下各个文件夹占用空间大小
是空间不足的问题。
pip install .whl 报错 zipfile.BadZipFile: File is not a zip file
原因是下载的过程中包出现了丢失,重新下载即可。可以换个源下载。
Win10 环境
scipy 报错 ImportError: DLL load failed
D:\program\anaconda3\envs\wav2lip\python.exe D:/0xz/code/wav2lip/inference.py
Traceback (most recent call last):
File "D:/0xz/code/wav2lip/inference.py", line 3, in <module>
import scipy, cv2, os, sys, argparse, audio
File "D:\0xz\code\wav2lip\audio.py", line 1, in <module>
import librosa
File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\librosa\__init__.py", line 13, in <module>
from . import core
File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\librosa\core\__init__.py", line 114, in <module>
from .time_frequency import * # pylint: disable=wildcard-import
File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\librosa\core\time_frequency.py", line 10, in <module>
from ..util.exceptions import ParameterError
File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\librosa\util\__init__.py", line 72, in <module>
from ._nnls import * # pylint: disable=wildcard-import
File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\librosa\util\_nnls.py", line 13, in <module>
import scipy.optimize
File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\scipy\optimize\__init__.py", line 387, in <module>
from .optimize import *
File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\scipy\optimize\optimize.py", line 36, in <module>
from ._numdiff import approx_derivative
File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\scipy\optimize\_numdiff.py", line 6, in <module>
from scipy.sparse.linalg import LinearOperator
File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\scipy\sparse\linalg\__init__.py", line 111, in <module>
from .isolve import *
File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\scipy\sparse\linalg\isolve\__init__.py", line 4, in <module>
from .iterative import *
File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 8, in <module>
from . import _iterative
ImportError: DLL load failed: 找不到指定的模块。
Process finished with exit code 1
卸载重装scipy。
pip uninstall scipy
pip install scipy
OSError: cannot load library ‘libsndfile.dll’: error 0x7e
重新安装soundfile
pip uninstall -y cffi pycparser SoundFile pip install soundfile