Background:
The project is built based on virtual environment, and the third-party packages are actually installed in:
E:\PyProject\py_basic\Lib\site-packages is not the same directory as Python installation directory
Question:
Both pycham and CMD can operate normally, but Jenkins build error:
C:\Users\86158\.jenkins\workspace\ihrm_code>python run_suite.py
Traceback (most recent call last):
File "run_suite.py", line 3, in <module>
from htmltestreport import HTMLTestReport
ModuleNotFoundError: No module named 'htmltestreport'
Solution:
Add environment variables to Jenkins. This problem is usually caused by the configuration of environment variables
Similar Posts:
- Python for mac or windows: ModuleNotFoundError: No module named ‘lxml’ [How to Solve]
- How to Solve Centos Yum Error: No module named yum
- Solution of import Cafe error reporting in Python command line
- jupyter notebook error: No module named ‘tensorflow’
- [Solved] Django cannot create an app after creating a project
- How to Solve ModuleNotFoundError: No module named ‘pip._internal’
- python mac install MySQLdb ModuleNotFoundError No module named ‘ConfigParser’
- [Solved] Jenkins Run python Project Error: “ModuleNotFoundError: No module named ‘xxx‘”
- [Solved] Python3 Error: ModuleNotFoundError: No module named ‘_bz2’