You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Faceswap.py启动失败求助:模块缺失与路径导入错误问题

Troubleshooting Faceswap.py Startup Failures in Python 3.8.5

Let’s work through these issues one by one, focusing first on the most blocking and unusual final error:

1. Fixing Missing Dependencies (tqdm, pynvml)

Manually installing individual packages is error-prone—Faceswap maintains a curated set of dependencies that should be installed in bulk to avoid version mismatches. Instead of installing tqdm and pynvml one-off, navigate to your Faceswap directory in PowerShell and run:

pip install -r requirements.txt

If you’re sticking to CPU mode (since you hit the NVML library warning), use the CPU-specific requirements file if it exists (check the Faceswap repo for requirements-cpu.txt):

pip install -r requirements-cpu.txt

This ensures you get all correct versions of every dependency, not just the ones you noticed were missing.

2. Resolving the "NVML Shared Library Not Found" Warning

This warning appears when pynvml can’t locate NVIDIA’s driver libraries (common if you don’t have an NVIDIA GPU or haven’t installed the full CUDA toolkit). Switching to CPU mode was the right call here—just make sure you launch Faceswap with the --cpu flag if required, or set the mode in your config file.

3. Fixing ModuleNotFoundError: No module named 'Users'

This odd error almost always stems from Windows path parsing issues. Here’s what to check:

  • Avoid spaces in installation paths: If your Faceswap folder or Python virtual environment lives in a path like C:\Users\Your Name\Faceswap, the space in your username might cause a script to misinterpret part of the path as a module name. Try moving Faceswap to a space-free path (e.g., C:\Faceswap).
  • Verify virtual environment activation: If using a virtual environment, ensure you’ve activated it correctly in PowerShell before launching Faceswap:
    .\your-venv-folder\Scripts\Activate.ps1
    
    Using the global Python install can lead to path conflicts that trigger this error.
  • Inspect config files: Open your Faceswap config.ini (or any custom configs) and check all path settings. If you entered a relative path like Users\YourName\data instead of the full absolute path C:\Users\YourName\data, Python might try to import Users as a module instead of treating it as a filesystem path.
  • Reinstall Faceswap: A partial download or corrupted script could cause this. Try cloning the latest stable Faceswap repo fresh, or re-download the release zip, then re-install dependencies with the requirements file.
  • Analyze the error traceback: Your screen recording screenshots should show a full error stack (lines starting with File "somefile.py", line X, in <module>). Look for which script is trying to import Users—this will pinpoint exactly where path parsing is broken. For example, if it’s in a custom script you wrote, you might have a typo in how you reference a file path.

Final Checks

Double-check that Python 3.8.5 is fully compatible with the latest Faceswap version. While 3.8 is generally supported, some newer features might require a slightly newer Python version (like 3.9+). If all else fails, try matching the exact Python version you used on your old working setup.

内容的提问来源于stack exchange,提问作者Blenderer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 23:42:59