Ubuntu环境

ImportError: libXrender.so.1: cannot open shared object file

报错信息

  1. Traceback (most recent call last):
  2. File "inference.py", line 3, in <module>
  3. import scipy, cv2, os, sys, argparse, audio
  4. File "/home/dgene/anaconda3/envs/wav2lip/lib/python3.6/site-packages/cv2/__init__.py", line 181, in <module>
  5. bootstrap()
  6. File "/home/dgene/anaconda3/envs/wav2lip/lib/python3.6/site-packages/cv2/__init__.py", line 153, in bootstrap
  7. native_module = importlib.import_module("cv2")
  8. File "/home/dgene/anaconda3/envs/wav2lip/lib/python3.6/importlib/__init__.py", line 126, in import_module
  9. return _bootstrap._gcd_import(name[level:], package, level)
  10. ImportError: libXrender.so.1: cannot open shared object file: No such file or directory

解决:

  1. 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’

  1. 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 * 当前目录下各个文件夹占用空间大小
image.png
image.png
是空间不足的问题。

pip install .whl 报错 zipfile.BadZipFile: File is not a zip file

原因是下载的过程中包出现了丢失,重新下载即可。可以换个源下载。

Win10 环境

scipy 报错 ImportError: DLL load failed

  1. D:\program\anaconda3\envs\wav2lip\python.exe D:/0xz/code/wav2lip/inference.py
  2. Traceback (most recent call last):
  3. File "D:/0xz/code/wav2lip/inference.py", line 3, in <module>
  4. import scipy, cv2, os, sys, argparse, audio
  5. File "D:\0xz\code\wav2lip\audio.py", line 1, in <module>
  6. import librosa
  7. File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\librosa\__init__.py", line 13, in <module>
  8. from . import core
  9. File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\librosa\core\__init__.py", line 114, in <module>
  10. from .time_frequency import * # pylint: disable=wildcard-import
  11. File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\librosa\core\time_frequency.py", line 10, in <module>
  12. from ..util.exceptions import ParameterError
  13. File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\librosa\util\__init__.py", line 72, in <module>
  14. from ._nnls import * # pylint: disable=wildcard-import
  15. File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\librosa\util\_nnls.py", line 13, in <module>
  16. import scipy.optimize
  17. File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\scipy\optimize\__init__.py", line 387, in <module>
  18. from .optimize import *
  19. File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\scipy\optimize\optimize.py", line 36, in <module>
  20. from ._numdiff import approx_derivative
  21. File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\scipy\optimize\_numdiff.py", line 6, in <module>
  22. from scipy.sparse.linalg import LinearOperator
  23. File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\scipy\sparse\linalg\__init__.py", line 111, in <module>
  24. from .isolve import *
  25. File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\scipy\sparse\linalg\isolve\__init__.py", line 4, in <module>
  26. from .iterative import *
  27. File "D:\program\anaconda3\envs\wav2lip\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 8, in <module>
  28. from . import _iterative
  29. ImportError: DLL load failed: 找不到指定的模块。
  30. Process finished with exit code 1

卸载重装scipy。

  1. pip uninstall scipy
  2. pip install scipy

OSError: cannot load library ‘libsndfile.dll’: error 0x7e

重新安装soundfile

  1. pip uninstall -y cffi pycparser SoundFile pip install soundfile