No module named 'dna' #59

Open
opened 2024-09-29 02:33:10 +08:00 by Khalil-Chiao · 1 comment
Khalil-Chiao commented 2024-09-29 02:33:10 +08:00 (Migrated from github.com)

Dear smilicev
marijavik,

Hello! I encountered an issue while using the code you provided, and I hope to get your assistance.

When attempting to run the following code:

This example demonstrates Maya UI Window for simple and non-programmatic creation the scene with the creating functional rig.
IMPORTANT: You have to setup the environment before running this example. Please refer to the 'Environment setup' section in README.md.

  • usage in command line:
    NOTE: Script cannot be called with Python or mayapy, it must be called in Maya Script Editor.
  • usage in Maya:
    Expected: Maya will show UI.

"""

This example is intended to be used in Maya

import dna_viewer

dna_viewer.show()

I received the following error message:

错误: ModuleNotFoundError: file C:\dna_calibration\dna_viewer\dnalib\dnalib.py line 3: No module named 'dna'

After checking, I found that dna is not a folder but a missing module file. Here are the steps I have tried:

Confirmed the project structure and ensured that all dependencies are in the specified paths.
Attempted to add the path containing the dna module to sys.path, but the issue persists.
I would appreciate any guidance or suggestions you could provide so that I can use the code successfully. Thank you for your hard work!

Looking forward to your response!

Dear smilicev marijavik, Hello! I encountered an issue while using the code you provided, and I hope to get your assistance. When attempting to run the following code: This example demonstrates Maya UI Window for simple and non-programmatic creation the scene with the creating functional rig. IMPORTANT: You have to setup the environment before running this example. Please refer to the 'Environment setup' section in README.md. - usage in command line: NOTE: Script cannot be called with Python or mayapy, it must be called in Maya Script Editor. - usage in Maya: Expected: Maya will show UI. """ # This example is intended to be used in Maya import dna_viewer dna_viewer.show() I received the following error message: # 错误: ModuleNotFoundError: file C:\dna_calibration\dna_viewer\dnalib\dnalib.py line 3: No module named 'dna' After checking, I found that dna is not a folder but a missing module file. Here are the steps I have tried: Confirmed the project structure and ensured that all dependencies are in the specified paths. Attempted to add the path containing the dna module to sys.path, but the issue persists. I would appreciate any guidance or suggestions you could provide so that I can use the code successfully. Thank you for your hard work! Looking forward to your response!
marijavik commented 2024-10-07 16:29:02 +08:00 (Migrated from github.com)

Hello @Khalil-Chiao,

It looks that dna lib is not on the path. Check the following code and replace the paths:

from sys import path as syspath
from sys import platform

ROOT_DIR = "D:/work/MetaHuman-DNA-Calibration"

MAYA_VERSION = "2022"  # 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"
    )


syspath.insert(0, ROOT_DIR)
syspath.insert(0, LIB_DIR)

import dna_viewer
dna_viewer.show()
Hello @Khalil-Chiao, It looks that dna lib is not on the path. Check the following code and replace the paths: ``` from sys import path as syspath from sys import platform ROOT_DIR = "D:/work/MetaHuman-DNA-Calibration" MAYA_VERSION = "2022" # 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" ) syspath.insert(0, ROOT_DIR) syspath.insert(0, LIB_DIR) import dna_viewer dna_viewer.show() ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: CGNICO/Metahuman_DNA_Calibration#59
No description provided.