程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

When Jenkins builds a python script, he reports modulenotfounderror: no module named xxx

編輯:Python

scene :

stay PyCharm And terminal operation .py All files are running normally , No report error , stay Jenkins Build Python Report errors

Causes and Solutions :

  One 、 On the Internet, there are arguments about right and wrong root Permission to install xlrd plug-in unit , Permission error caused by  Jenkins function python Prompt when import error_u012928160 The blog of -CSDN Blog

Two 、 My case is the second case , The plug-in directory I installed and the project are no longer in the same directory

That is, execute... On the command line .py The package cannot be found when the file is loaded because we did not save the project path , It can be done by sys.path.append() Save your project path , It's going to work

solve :

  The one who reported the error py In file , take xlrd The location of the plug-in package is saved , Then it can run normally

 python Command line execution .py File tips ModuleNotFoundError: No module named 'XXX' resolvent _jianglianye21 The blog of -CSDN Blog

 


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved