我的ImportError
为ImportError: cannot import name filter_name
仅使用此行FilterTest.py
执行from Filter2D import filter_name
我可以轻松地从其他.py
文件导入函数,但使用filter_name
中FilterTest.py
函数的相同路径,我收到此错误。我只能找到与循环导入相关的ImportErrors问题,我无法将其减少到它。我做错了什么?
try2/
- asian.py
- toAsian()
- europe.py
- man2euro()
- euro2asian()
- Filter2D.py
-- from FilterMain import filter
- filter_name() -> filter()
- FilterMain.py
-- from asian import toAsian
-- from europe import euro2asian
- filter() -> toAsian(), euro2asian()
- FilterTest.py
#-- from asian import toAsian # works well
#-- from europe import euro2asian # works well
#-- import Filter2D # works well
-- from Filter2D import filter_name # ImportError: cannot import name filter_name