Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: DLL load failed while importing ebsynth: The specified module could not be found. #12

Closed
Trentonom0r3 opened this issue Sep 27, 2023 · 9 comments

Comments

@Trentonom0r3
Copy link
Owner

          Nice, saw the dev branch got updated also new readme, ta !

Though im running into this trying to run the dev branch
ImportError: DLL load failed while importing ebsynth: The specified module could not be found.

Dont think i was running into this trying main a while back.

Originally posted by @DrakenZA in #5 (comment)

@Trentonom0r3
Copy link
Owner Author

Researching-- Info that would be useful from anyone else experiencing this;

  • Pip List showing ezsynth 1.2.1.0 installed.
  • Any other errors that may be shown
  • any test scripts you're using

@Trentonom0r3 Trentonom0r3 mentioned this issue Sep 27, 2023
@Trentonom0r3 Trentonom0r3 pinned this issue Sep 27, 2023
@DrakenZA
Copy link

DrakenZA commented Sep 27, 2023

einops                  0.6.1
eventlet                0.33.3
exceptiongroup          1.1.3
executing               1.2.0
ezsynth                 1.2.1.0
faiss-cpu               1.7.3
filelock                3.9.0
Flask                   2.2.3

I didnt get any other errors then this, and its when it tries to import the ezsynth lib.

Im running the provided example

from ezsynth import Ezsynth


STYLE_PATHS = [
    r"E:\Downloads\EbSynth-Beta-Win\New folder\keys\frame-0001.png",
    r"E:\Downloads\EbSynth-Beta-Win\New folder\keys\frame-0017.png",
    r"E:\Downloads\EbSynth-Beta-Win\New folder\keys\frame-0033.png",
    r"E:\Downloads\EbSynth-Beta-Win\New folder\keys\frame-0049.png"
]

IMAGE_FOLDER = r"E:\Downloads\EbSynth-Beta-Win\New folder\video"
OUTPUT_FOLDER = r"E:\Downloads\EbSynth-Beta-Win\New folder\video\\test"

ez = Ezsynth(styles=STYLE_PATHS, imgsequence=IMAGE_FOLDER, flow_model='sintel')
ez.set_guides().stylize(output_path=OUTPUT_FOLDER)
# results = ez.set_guides().stylize() # returns a list of images as numpy arrays

@Trentonom0r3
Copy link
Owner Author

einops                  0.6.1
eventlet                0.33.3
exceptiongroup          1.1.3
executing               1.2.0
ezsynth                 1.2.1.0
faiss-cpu               1.7.3
filelock                3.9.0
Flask                   2.2.3

I didnt get any other errors then this, and its when it tries to import the ezsynth lib.

Im running the provided example

from ezsynth import Ezsynth


STYLE_PATHS = [
    r"E:\Downloads\EbSynth-Beta-Win\New folder\keys\frame-0001.png",
    r"E:\Downloads\EbSynth-Beta-Win\New folder\keys\frame-0017.png",
    r"E:\Downloads\EbSynth-Beta-Win\New folder\keys\frame-0033.png",
    r"E:\Downloads\EbSynth-Beta-Win\New folder\keys\frame-0049.png"
]

IMAGE_FOLDER = r"E:\Downloads\EbSynth-Beta-Win\New folder\video"
OUTPUT_FOLDER = r"E:\Downloads\EbSynth-Beta-Win\New folder\video\\test"

ez = Ezsynth(styles=STYLE_PATHS, imgsequence=IMAGE_FOLDER, flow_model='sintel')
ez.set_guides().stylize(output_path=OUTPUT_FOLDER)
# results = ez.set_guides().stylize() # returns a list of images as numpy arrays

hmm. That is an odd one.
Try manually uninstalling, then re-installing, as well as clearing cache.
It's possible older version is still mixed in with the new one somehow, causing the issue.

Check your python folder, should be something like this.

C:\Python311\Lib\site-packages\ezsynth

Your folder in that path should have these files;

"C:\Python311\Lib\site-packages\ezsynth\image_style.py"
"C:\Python311\Lib\site-packages\ezsynth\opencv_world480.dll"
"C:\Python311\Lib\site-packages\ezsynth\optical_flow.py"
"C:\Python311\Lib\site-packages\ezsynth\reconstruction.py"
"C:\Python311\Lib\site-packages\ezsynth\stylizer.py"
"C:\Python311\Lib\site-packages\ezsynth\stylizevideo.py"
"C:\Python311\Lib\site-packages\ezsynth\utils.py"
"C:\Python311\Lib\site-packages\ezsynth\__pycache__"
"C:\Python311\Lib\site-packages\ezsynth\alt_cuda_corr"
"C:\Python311\Lib\site-packages\ezsynth\core"
"C:\Python311\Lib\site-packages\ezsynth\models"
"C:\Python311\Lib\site-packages\ezsynth\__init__.py"
"C:\Python311\Lib\site-packages\ezsynth\classutils.py"
"C:\Python311\Lib\site-packages\ezsynth\ebsynth.pyd"
"C:\Python311\Lib\site-packages\ezsynth\edge_detection.py"
"C:\Python311\Lib\site-packages\ezsynth\guide_classes.py"
"C:\Python311\Lib\site-packages\ezsynth\histogram_blend.py"

You can try manually deleting the pycache there as well.

@DrakenZA
Copy link

Damn not sure. Tried removing everything related to it, the folder structure and contents is the same in the site-pkgs etc

@Trentonom0r3
Copy link
Owner Author

Damn not sure. Tried removing everything related to it, the folder structure and contents is the same in the site-pkgs etc

What python version are you using?

32 bit or 64 bit?

You can also try this test script out, just add the path to the .pyd from your installation.

import ctypes
import os

# Replace this with the actual path to your .pyd file
pyd_path = ""

if os.path.exists(pyd_path):
    try:
        ctypes.cdll.LoadLibrary(pyd_path)
        print("Successfully loaded .pyd")
    except Exception as e:
        print("Failed to load .pyd:", str(e))
else:
    print(f".pyd file not found at {pyd_path}")

If that returns any errors please post them here.
If it doesn't... back to the drawing board, lol.
Sorry for all the trouble!

@DrakenZA
Copy link

All good :)

Failed to load .pyd: Could not find module 'C:\Users\User\Desktop\Ezsynth-dev\ezsynth\ebsynth.pyd' (or one of its dependencies). Try using the full path with constructor syntax.

The file is there

Also tried

Failed to load .pyd: Could not find module 'C:\Users\User\AppData\Local\Programs\Python\Python310\Lib\site-packages\ezsynth\ebsynth.pyd' (or one of its dependencies). Try using the full path with constructor syntax.

@Trentonom0r3
Copy link
Owner Author

All good :)

Failed to load .pyd: Could not find module 'C:\Users\User\Desktop\Ezsynth-dev\ezsynth\ebsynth.pyd' (or one of its dependencies). Try using the full path with constructor syntax.

The file is there

Also tried

Failed to load .pyd: Could not find module 'C:\Users\User\AppData\Local\Programs\Python\Python310\Lib\site-packages\ezsynth\ebsynth.pyd' (or one of its dependencies). Try using the full path with constructor syntax.

Ahhh, I think I figured it out.
Library is built for python 3.11, you're on 3.10.
I wouldn't expect it to cause the issue, but I just tried importing ezsynth in 3.10 vs 3.11, and it only worked in 3.11 for me.

@DrakenZA
Copy link

ahh nice. Good work tracking it down ! Will open a venv.

@Trentonom0r3
Copy link
Owner Author

ahh nice. Good work tracking it down ! Will open a venv.

Great! Let me know if it works out or just close the issue so I know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants