【发布时间】:2022-07-07 21:40:06
【问题描述】:
我在“cmd”中使用 pytest 进行了单元测试,它工作正常,但是当我尝试导入我的主文件时出现导入错误。这是我的文件树结构:
MATCHING_CC/
- pytest.ini
- __init__.py (empty file)
- conftest.py (empty file)
- src/
- __init__.py (empty file)
- conftest.py (empty file)
- matching_ingr_zing.py
- services/
- __init__.py (empty file)
- ElasticSearch.py
- ingredient_extractor_for_search.py
- metrics.py
- stop_word_matching.py
- models/ (folder to save trained models)
- tests/
- __init__.py (empty file)
- test_services/
- __init__.py (empty file)
- test_elastic_search.py
- test_ingredient_extractor_for_search.py
- test_metrics.py
- test_src/
- __init__.py (empty file)
- test_matching_ingr_zingr.py
这里是问题的图像: error
如果有人可以帮助我并解释我的错误是什么,我将非常感激。
【问题讨论】:
标签: python visual-studio-code python-import importerror src