Unresolved reference when importing from sibling sub-package with

前端 未结 2 1417
生来不讨喜
生来不讨喜 2020-12-29 13:25

I have following similar directory structure.

main.py
pack
   |___sub_pack1
                |__a.py
   |___sub_pack2
                |__b.py
<
相关标签:
2条回答
  • 2020-12-29 14:08

    Another thing you can do if you're having trouble with "Unsolved reference" errors in PyCharm is:

    • Right-click on the Python sources directory
    • Select "Mark Directory As" > "Source Root"

    Make sure you've done this for all your Python source directories.

    0 讨论(0)
  • 2020-12-29 14:19

    Go to settings-> project structure and sub_pack2 as a source

    0 讨论(0)
提交回复
热议问题