记录一次pycharm中,引入其他类可用,下面总是有波浪线,而且Ctrl+b 无法查看类函数的源码

    最近在玩python,发现引入其他的函数们总是有波浪线,但是能够使用,crtl+b却无法看到,非常尴尬,然后查看了原因,记录如下:

      This inspection detects names that should resolve but don'(ctrl+f1)t. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items.
     解决的方法如下:   

     在pycharm中设置source路径

    file–setting(或者ctrl+alt+s)–project structure

    将放package的文件夹设置为source,这样import的模块类等,就是通过这些source文件夹作为根路径来查找,也就是在这些source文件夹中查找import的东西。 

 


 

posted @ 2019-07-20 23:26  风清扬不在华山  阅读(542)  评论(0编辑  收藏  举报
2