SyntaxError When importing Modules

17 views
Skip to first unread message

Sachendra Shukla

unread,
Dec 3, 2020, 10:26:33 PM12/3/20
to Python Programming for Autodesk Maya
Hi Guys,

When I run this Code in Maya. 

import os 

try:
riggingToolRoot = os.environ ["RIGGING_TOOL_ROOT"]
except :
print ("RIGGING_TOOL_ROOT is not correctly Configured")
else :
import sys
print (riggingToolRoot)
Path = riggingToolRoot + "/Modules"
if not Path in sys.path:
sys.path.append(Path)
import System.blueprint_UI as blueprint_UI
reload (blueprint_UI)
UI = blueprint_UI.Blueprint_UI()

I get Error   # Error: SyntaxError: file <maya console> line 17: invalid syntax # 

anyone can tell me why is happening?  where I am Wrong?

Thank You.
error.PNG

Justin Israel

unread,
Dec 4, 2020, 12:58:54 AM12/4/20
to python_in...@googlegroups.com
Are there any weird characters in there? Does a proper ide flag it as having syntax errors? 

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c43c0171-129c-4100-b3b7-a7fb57a8d0b7n%40googlegroups.com.

Sachendra Shukla

unread,
Dec 4, 2020, 3:10:30 AM12/4/20
to Python Programming for Autodesk Maya
Hi Justin,

Only this line makes SyntaxError  -->  import System.blueprint_UI as blueprint_UI 

I think there is no any weird character in a line.

and I also attach the file path of "blueprint_UI" so you can check where is the mistake 
PathOfModules.PNG.jpg

Jakob Kousholt

unread,
Dec 4, 2020, 4:33:58 AM12/4/20
to python_inside_maya
This is a bit of a mystery to me. I copied your code and ran it with one slight modification. It seems to work on my end. (the Blueprint_UI function call just prints "hello" in my case). Hmm.

syntaxerr.png

Sachendra Shukla

unread,
Dec 4, 2020, 8:44:28 AM12/4/20
to python_in...@googlegroups.com
Hi, Jakob

Thank you so much for Helping. now I find the error and fix it. as you say blueprint_UI.py file has bad code that's why I get  SyntaxError.





On Fri, Dec 4, 2020 at 3:03 PM Jakob Kousholt <jak...@gmail.com> wrote:
This is a bit of a mystery to me. I copied your code and ran it with one slight modification. It seems to work on my end. (the Blueprint_UI function call just prints "hello" in my case). Hmm.

syntaxerr.png

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages