Spyder提示ValueError: API 'QString' has already been set to version 1

时间:2014-07-09 21:47:51   收藏:0   阅读:1422

转载自:http://wuyuans.com/2013/02/spyder-valueerror-api-qstring-has-already-been-set-to-version-1/

在IPython中使用enthought.mayavi正常,但在Spyder中确有问题,提示如下:

ValueError: API ‘QString‘ has already been set to version 1

问题出在import这里,

from enthought.mayavi import mlab

因为Enthought在调用PyQt时使用的是API #2,而Spyder默认使用API #1,把他改为API #2即可。

打开Tools -> Preferences,左边选择Console,右边打开External modules选项卡,在下面找到PyQt,把里面的API selection for QString and QVariant object:改为API #2,确定,再次运行时就正常了。

Spyder提示ValueError: API 'QString' has already been set to version 1,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!