Import own .py files in anaconda spyder

后端 未结 5 1650
梦毁少年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:48

    There are many options, e.g.

    • Place the mail.py file alongside the other python files (this works because the current working dir is on the PYTHONPATH.
    • Save a copy of mail.py in the anaconda python environment's "/lib/site-packages" folder so it will be available for any python script using that environment.

提交回复
热议问题