PyCharm error: 'No Module' when trying to import own module (python script)

前端 未结 14 1827
醉话见心
醉话见心 2020-12-07 07:57

I have written a module (a file my_mod.py file residing in the folder my_module). Currently, I am working in the file cool_script.py t

14条回答
  •  星月不相逢
    2020-12-07 08:19

    If your own module is in the same path, you need mark the path as Sources Root. In the project explorer, right-click on the directory that you want import. Then select Mark Directory As and select Sources Root.

    I hope this helps.

提交回复
热议问题