[Solved] jenkins Build python Program Error: ModuleNotFoundError: No module named ‘htmltestreport’


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


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'


Add environment variables to Jenkins. This problem is usually caused by the configuration of environment variables

Similar Posts: