Import own .py files in anaconda spyder

后端 未结 5 1636
梦毁少年i
梦毁少年i 2021-02-14 16:21

I\'ve written my own mail.py module in spider (anaconda). I want to import this py file in other python (spider) files just by \'import mail\'

I searched on the internet

5条回答
  •  北恋
    北恋 (楼主)
    2021-02-14 16:38

    I had the same problem, my files were in same folder, yet it was throwing an error while importing the "to_be_imported_file.py".

    I had to run the "to_be_imported_file.py" seperately before importing it to another file.

    I hope it works for you too.

提交回复
热议问题