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

No module named 'dna' #59

Open
Khalil-Chiao opened this issue Sep 28, 2024 · 1 comment
Open

No module named 'dna' #59

Khalil-Chiao opened this issue Sep 28, 2024 · 1 comment

Comments

@Khalil-Chiao
Copy link

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
Copy link
Contributor

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()

@EpicGames EpicGames deleted a comment from kalebzaki4 Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants