W10,使用命令提示符(不是Cygwin)。Python 3.8.5
我已经安装(使用pip)pytest并开始使用它OK。我还使用pip安装了BeautifulSoup4,并开始使用它OK(在非测试文件中)
但是,当我尝试使用pytest运行一个包含行import bs4
的文件时,它会抱怨:
_
ImportError while importing test module 'D:\more software projects\Visual_Studio\caat-testing\caat-test1\url_test\test_caat_url.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
d:\apps\python\python36\lib\importlib\__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
test_caat_url.py:56: in <module>
from bs4 import BeautifulSoup
E ModuleNotFoundError: No module named 'bs4'
。。。有人知道问题出在哪里吗
这里是一个低级Python用户。我只知道我在W10中安装了一个Python虚拟环境,并使用相同的版本(3.8.5),然后安装(使用
pip
、requests
、beautifulsoup4
和pytest
。一切正常相关问题 更多 >
编程相关推荐