EpicGames / MetaHuman-DNA-Calibration

https://epicgames.github.io/MetaHuman-DNA-Calibration/
Other
452 stars 118 forks source link

Dll load still not working #3

Closed VictorBell closed 1 year ago

VictorBell commented 1 year ago

/lib/windows\dna.py", line 15, in import _py3dna ImportError: DLL load failed while importing _py3dna

vvukobrat commented 1 year ago

Hi! Which python version are you using? It's possible that that is causing the issue - could you try with 3.7?

smilicev commented 1 year ago

@VictorBell Thanks for reporting issue, but as @vvukobrat said problem is caused by using unsupported version of python.

Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import dna
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\source\MetaHuman-DNA-Calibrationhttp\MetaHuman-DNA-Calibration\lib\windows\dna.py", line 15, in <module>
    import _py3dna
ImportError: DLL load failed while importing _py3dna: The specified module could not be found.

This error occurs when you are using some different version of python 3.7.

This is output for Python 3.7 or mayapy from Maya 2022 (which is also python 3.7)

Python 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import dna
>>> import dnacalib

I will close this issue. If you problem persists. Please reopen this issue and provide us with more details.

1165048017 commented 1 year ago

If python3.7.7 can't solve this issue, we can use mayapy.exe to check if import dna can work. Then we can use the same python version as mayapy; for now(2023.8.3), the version 3.9.7 can solve this issue. Remember to add the path using the following code first:

from os import path as ospath
from sys import path as syspath
from sys import platform

ROOT_DIR = "XXXX/MetaHuman-DNA-Calibration-1.2.0/" #f"{ospath.dirname(ospath.abspath(__file__))}/..".replace("\\", "/")
MAYA_VERSION = "2023"  # or 2023
ROOT_LIB_DIR = f"{ROOT_DIR}/lib/Maya{MAYA_VERSION}"
if platform == "win32":
    LIB_DIR = f"{ROOT_LIB_DIR}/windows"
elif platform == "linux":
    LIB_DIR = f"{ROOT_LIB_DIR}/linux"
else:
    raise OSError(
        "OS not supported, please compile dependencies and add value to LIB_DIR"
    )

# Adds directories to path
syspath.insert(0, ROOT_DIR)
syspath.insert(0, LIB_DIR)