Python

如何使用jenkins修復python模組未找到錯誤?

  • December 31, 2021

我用我的詹金斯工作執行了 pip freeze 命令,下面是輸出

pip freeze 
fpdf==1.7.2
textfile==0.1.4

pip install textfile 
Requirement already satisfied: textfile in c:\python39\lib\site-packages (0.1.4)

但是當我將 python 腳本作為作業執行時,出現如下錯誤。

$ python C:\Users\ADMINI~1\AppData\Local\Temp\jenkins2938633000292670144.py
Traceback (most recent call last):
 File "C:\Users\ADMINI~1\AppData\Local\Temp\jenkins2938633000292670144.py", line 1, in <module>
   import textile
ModuleNotFoundError: No module named 'textile'
Build step 'Execute Python script' marked build as failure
No emails were triggered.
Finished: FAILURE
pip install text*f*ile 
Requirement already satisfied: textfile in c:\python39\lib\site-packages (0.1.4)
ModuleNotFoundError: No module named 'text*i*le'

不是抱怨找不到文本文件;它抱怨沒有找到紡織品。

安裝並重textile試。

引用自:https://serverfault.com/questions/1088688