昨天晚上电脑提示更新,没理他,结果早上要看系统自动更新重启了已经。重新启动faceswap的时候就报了下面的错误:
代码语言:javascript复制F:faceswapfs>"C:UsersobabyAnaconda3scriptsactivate.bat" && conda activate "fs" && python "F:faceswapfaceswap/faceswap.py" gui
Setting Faceswap backend to NVIDIA
12/16/2021 07:22:00 INFO Log level set to: INFO
12/16/2021 07:22:04 ERROR Got Exception on main handler:
Traceback (most recent call last):
File "F:faceswapfaceswaplibclilauncher.py", line 180, in execute_script
script = self._import_script()
File "F:faceswapfaceswaplibclilauncher.py", line 46, in _import_script
module = import_module(mod)
File "E:anaconda_dirsvenvsfslibimportlib__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "F:faceswapfaceswapscriptsgui.py", line 9, in <module>
from lib.gui import (TaskBar, CliOptions, CommandNotebook, ConsoleOut, DisplayNotebook,
File "F:faceswapfaceswaplibgui__init__.py", line 12, in <module>
from lib.gui.wrapper import ProcessWrapper
File "F:faceswapfaceswaplibguiwrapper.py", line 18, in <module>
import win32console # pylint: disable=import-error
ImportError: DLL load failed while importing win32console: 找不到指定的模块。
12/16/2021 07:22:04 CRITICAL An unexpected crash has occurred. Crash report written to 'F:faceswapfaceswapcrash_report.2021.12.16.072202080315.log'. You MUST provide this file if seeking assistance. Please verify you are running the latest version of faceswap before reporting
尝试通过pip安装pywin32发现已经存在了:
代码语言:javascript复制(E:anaconda_dirsvenvsfs) C:Usersobaby>pip install pypiwin32
Collecting pypiwin32
Downloading pypiwin32-223-py3-none-any.whl (1.7 kB)
Requirement already satisfied: pywin32>=223 in e:anaconda_dirsvenvsfslibsite-packages (from pypiwin32) (302)
Installing collected packages: pypiwin32
Successfully installed pypiwin32-223
(E:anaconda_dirsvenvsfs) C:Usersobaby>pip install pywin32
Requirement already satisfied: pywin32 in e:anaconda_dirsvenvsfslibsite-packages (302)
运行依旧报错,后来搜索了一下发现了这个帖子https://blog.csdn.net/ljr_123/article/details/104693372,
参考里面的步骤:
1.从https://pypi.org/project/pywin32/#description下载对应的安装包。
2.解压之后通过下面的命令安装:
代码语言:javascript复制python Scripts/pywin32_postinstall.py -install
安装日志:
代码语言:javascript复制(E:anaconda_dirsvenvsfs) C:Usersobaby>python C:UsersobabyDownloadspywin32-302.win-amd64-py3.8SCRIPTSpywin32_postinstall.py -install
Parsed arguments are: Namespace(destination='E:\anaconda_dirs\venvs\fs\Lib\site-packages', install=True, quiet=False, remove=False, silent=False, wait=None)
Copied pythoncom38.dll to E:anaconda_dirsvenvsfspythoncom38.dll
Copied pywintypes38.dll to E:anaconda_dirsvenvsfspywintypes38.dll
You do not have the permissions to install COM objects.
The sample COM objects were not registered.
-> SoftwarePythonPythonCore3.8Help[None]=None
-> SoftwarePythonPythonCore3.8HelpPythonwin Reference[None]='E:\anaconda_dirs\venvs\fs\Lib\site-packages\PyWin32.chm'
Registered help file
Pythonwin has been registered in context menu
Creating directory E:anaconda_dirsvenvsfsLibsite-packageswin32comgen_py
Shortcut for Pythonwin created
Shortcut to documentation created
The pywin32 extensions were successfully installed.
对于这个错误的解决,其实官网上已经有提示了:
If you encounter any problems when upgrading (eg, “module not found” errors or similar), you should execute: python Scripts/pywin32_postinstall.py -install
安装之后会提示com组件没有安装:The sample COM objects were not registered.
此时运行需要com组件支持的代码就会提示下面的错误:
代码语言:javascript复制(E:anaconda_dirsvenvsfs) C:Usersobaby>anaconda upload C:UsersobabyDocumentsfs.yaml
Traceback (most recent call last):
File "C:UsersobabyAnaconda3Scriptsanaconda-script.py", line 5, in <module>
from binstar_client.scripts.cli import main
File "C:UsersobabyAnaconda3libsite-packagesbinstar_client__init__.py", line 17, in <module>
from .utils import compute_hash, jencode, pv
File "C:UsersobabyAnaconda3libsite-packagesbinstar_clientutils__init__.py", line 17, in <module>
from .config import (get_server_api, dirs, load_token, store_token,
File "C:UsersobabyAnaconda3libsite-packagesbinstar_clientutilsconfig.py", line 54, in <module>
USER_LOGDIR = dirs.user_log_dir
File "C:UsersobabyAnaconda3libsite-packagesbinstar_clientutilsappdirs.py", line 257, in user_log_dir
return user_log_dir(self.appname, self.appauthor,
File "C:UsersobabyAnaconda3libsite-packagesbinstar_clientutilsappdirs.py", line 205, in user_log_dir
path = user_data_dir(appname, appauthor, version); version = False
File "C:UsersobabyAnaconda3libsite-packagesbinstar_clientutilsappdirs.py", line 67, in user_data_dir
path = os.path.join(_get_win_folder(const), appauthor, appname)
File "C:UsersobabyAnaconda3libsite-packagesbinstar_clientutilsappdirs.py", line 284, in _get_win_folder_with_pywin32
from win32com.shell import shellcon, shell
ImportError: DLL load failed while importing shell: 找不到指定的程序。
尝试以管理员权限权限安装没有成功提示找不到pythonw_d.exe,早上时间太匆忙了,还没搞明白怎么解决,后续再去处理。不过到现在faceswap可以运行了。
☆文章版权声明☆
* 网站名称:obaby@mars
* 网址:https://h4ck.org.cn/
* 本文标题: 《ImportError: DLL load failed while importing win32console【pywin32】》
* 本文链接:https://cloud.tencent.com/developer/article/2221031
* 转载文章请标明文章来源,原文标题以及原文链接。请遵从 《署名-非商业性使用-相同方式共享 2.5 中国大陆 (CC BY-NC-SA 2.5 CN) 》许可协议。
分享文章:
相关文章:
- IDA python.plw: can’t load file
- 由apscheduler引发的django.db.utils.InternalError: (1054, u”Unknown column ‘rms.go_datetime’ in ‘field list'”)
- IDA failed to display the program in graph mode
- Cannot open pip-script.py
- Windows 10 yolov5 GPU环境
- M1 Mac 安装Tensorflow
- Install PyQt4 on Mac OSX 10.8
- Django 限制访问频率
- PyDbg安装(《Python 灰帽子》)
- PyTorch GPU 与虚拟内存