用 pip install 安装了wxpy这个库,但是使用的时候却报错:ImportError: No module named wxpy
我先用 pip list 查看了一下,发现这个库是已经存在的:
![](http://upload-images.jianshu.io/upload_images/3012096-cd26553131c3bdb5.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/368)
但是运行就老是报错
后来查了资料才知道,是我编译器的环境选择有问题,我使用的是pycharm
进入 file ——> setting ——> Project ——> Project Interpreter,查看当前列表下是否存在该库:
![](http://upload-images.jianshu.io/upload_images/3012096-1ec63f8bb074a6a0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000)
默认的路径下确实没有wxpy库
所以,我需要更改一下Project Interpreter的选项,然后就有了:
![](http://upload-images.jianshu.io/upload_images/3012096-ebbb397cafe5b7ed.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000)
此时,再去运行就不会报该错误了