Python Cannot set the undefined 'color' attribute of a 'Light' object.解决方案
1、安装的Python(x,y) 2.7.6 版本运行结果为黑色,显示错误
TraitError: Cannot set the undefined 'color' attribute of a 'Light' object.
解决方案:
将文件 *:\Python27\Lib\site-packages\tvtk\pyface\light_manager.py, CameraLight class, _color_changed method, change: self.source.color = val to self.color = val 在232行。2、AttributeError:'module'object has no attribute 'argv'
解决方案:
C++代码中添加:
PySys_SetArgv(argc, argv);
记得将main函数改为int main(int argc, char **argv)

浙公网安备 33010602011771号