用终端执行 module not found xxx,但是用终端执行 python 时 import xxx 可导入
第三方库:pandas;如果在终端直接执行 pytest,会报错:____________________ ERROR collecting tests/test.py _____________________
ImportError while importing test module ''.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name, package, level)
tests/test.py:17: in <module>
from utils import check, logger, excel_analyzer
utils/excel.py:4: in <module>
import pandas as pd
E ModuleNotFoundError: No module named 'pandas'但是直接在 python 命令行导入,没问题:
请问是因为 pytest 无法在 sh 中使用的原因吗?如何解决这个问题?
:) 环境没配置对 No module named 'pandas' 像缺环境
页:
[1]