import sys
for p in sys.path:
print p
rigDir = 'C:\Users\lenovo\Documents\maya\scripts\python\rigLib'
if not rigDir in sys.path:
sys.path.append( rigDir )
from rigLib.base.control import *
ArmCtl = rigLib.base.control.Control(prefix = '1_arm')
问题与解决方法
# Error: line 1: 'module' object has no attribute 'base'
# Traceback (most recent call last):
# File "", line 11, in
# AttributeError: 'module' object has no attribute 'base' #
https://stackoverflow.com/questions/25575073/attributeerror-module-object-has-no-attribute-tests
之后再maya.env 文件中添加了PYTHONPATH = C:\Users\lenovo\Documents\maya\scripts\python
import rigLib
c = rigLib.base.control.Control()
c.Off
这样也同样可以导入模块