PyCharm unresolved reference when importing class from other file

后端 未结 5 1209
遇见更好的自我
遇见更好的自我 2021-01-11 11:00

This problem has been driving me nuts. I am trying to import a class from a file in the same directory. PyCharm is giving me the \"Unresolved reference\" error. MyClas

5条回答
  •  离开以前
    2021-01-11 11:49

    Yes, if you are using python 3 you should add something like this:

    from .pack import MyClass
    

    It will work

提交回复
热议问题