简体   繁体   中英

importing py file error: no module named 'filename'

Every time I import py files to my main py file, it gives

no module named

error.

All are in the same folder.
I am working on spyder environment. Both my python and spyder are in the same path, too:

C:\ProgramData\Anaconda3

I think you have to add yourpath to $PYTHONPATH or sys.path . This might help How to fix "ImportError: No module named..." error in Python?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM