lllyasviel / lllyasviel/FramePack
ImportError: DLL load failed while importing cv2 (FramePack cu126 + opencv-python-headless fix not working)
- Dominant language
- Python
- Stars
- 17.3k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
Hi there,
I’ve been trying to get FramePack running on Windows with the framepack_cu126_torch26 package, and have hit persistent errors around cv2 failing to load. I've tried extensive troubleshooting, and at this point, I could use a second set of eyes.
**System Details**
OS: Windows 10 x64
Python version: 3.10.6 (bundled inside FramePack system\python)
FramePack folder: framepack_cu126_torch26
OpenCV used: opencv-python-headless==4.7.0.72
NumPy version: 1.23.5 (also tested with 2.2.6 but reverted due to ML lib incompatibility)
**Symptoms / Behavior**
When running run.bat or even testing a direct import:
bash
Copy
.\system\python\python.exe -c "import cv2; print(cv2.__version__)"
I consistently get:
lua
Copy
ImportError: DLL load failed while importing cv2: The specified module could not be found.
The cv2 folder exists in site-packages, but no cv2.cp310-win_amd64.pyd file is being installed even after full cleanup and wheel reinstall.
**What I’ve Already Tried**
✅ All virus protection and Windows Defender are disabled.
✅ Installed and repaired the latest Visual C++ Redistributables (x64 and x86).
✅ Verified no Python processes were locking files.
✅ Used handle.exe to kill any handles on cv2.
✅ Fully deleted all cv2 folders and .pyd files.
✅ Reinstalled opencv-python-headless==4.7.0.72 using:
bash
Copy
pip install --no-cache-dir --force-reinstall opencv-python-headless==4.7.0.72
✅ Tried both pip and direct wheel installs.
✅ Checked for missing DLLs using Dependency Walker — but couldn't check cv2.cp310-win_amd64.pyd because it never installs.
✅ Downgraded NumPy to 1.23.5 to avoid breaking other packages like gradio, matplotlib, etc.
**Other Notes**
The pip installer thinks OpenCV installed correctly, but the key .pyd file is just missing.
Tried both opencv-python and opencv-python-headless.
I’ve spent a lot of time troubleshooting, but haven’t even been able to test FramePack’s actual functionality yet.
**Request**
If there’s a recommended or pinned OpenCV version that works with this build of FramePack — or if there’s an internal OpenCV dependency the repo expects — I’d love to know. Open to trying a fresh environment or alternate config if one is known to work.
Thanks so much in advance for your time and help!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the failure with run.bat and the supplied system\python\python.exe -c "import cv2; print(cv2.__version__)" command. Inspect the FramePack cu126_torch26 environment and the opencv-python-headless==4.7.0.72 installation, then establish which supported package combination provides the missing cv2 module and allows the import to succeed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, opencv, python
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100