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

前端 未结 14 1834
醉话见心
醉话见心 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:23

    So if you go to

    -> Setting -> Project:My_project -> Project Structure,

    Just the directory in which the source code is available and mark it as "Sources" (You can see it on the same window). The directory with source code should turn blue. Now u can import in modules residing in same directory.

提交回复
热议问题