У меня есть программа python, которая должна работать в Jenkins job
. Но я получил ошибку ниже:
Started by user admin
Building in workspace /var/lib/jenkins/workspace/automatic_test
[automatic_test] $ /bin/sh -xe /tmp/jenkins257763233971180370.sh
+ cd /ext/data/nlu_test/ifly/job123
+ python3 bleu.py Zh ref_zh.txt translation_zh.txt
Traceback (most recent call last):
File "bleu.py", line 5, in <module>
import jieba
ImportError: No module named 'jieba'
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Пока я выполняю те же команды на Linux shell
, тогда он работает нормально, как показано ниже. Почему?
[jenkins@localhost ~]$ cd /ext/data/nlu_test/ifly/job123
[jenkins@localhost job123]$ ls
bleu.py input.orig.txt input.trans.txt input.txt ref_zh.txt splitText.py translation_zh.txt
[jenkins@localhost job123]$ python3 bleu.py Zh ref_zh.txt translation_zh.txt
W0310 00:06:37.430938 295363 init.cc:157] AVX is available, Please re-compile on local machine
Paddle enabled successfully......
reference 1: 3615
candidate: 3493
score: 31.8288254543782
[jenkins@localhost job123]$
И я установил python пакет jieba
уже как показано ниже.
[root@localhost ~]# pip3 install jieba
Requirement already satisfied: jieba in /usr/local/lib/python3.7/site-packages (0.42.1)
[root@localhost ~]# pip install jieba
Requirement already satisfied: jieba in /usr/local/lib/python3.7/site-packages (0.42.1)