PyCharm unresolved reference when importing class from other file

后端 未结 5 1270
遇见更好的自我
遇见更好的自我 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:44

    I had the same issue when I tried to import a new class, however I could successfully import functions from a file in the same directory. I still dont understand why I could not import my class but thought I would share the information for other users.

    @kaylebs response worked for me. However I then added the src directory to the list of source directories, first link in @lulian 's question and could remove the '.' from my file name.

提交回复
热议问题