admin管理员组

文章数量:1122846

I've done a script that add data from mantis ticket to my django table.

When i execute it directly on the machine, it work well.

But now i want to make it launch periodically from jenkins so i try to make a wrapper sh :

#!/bin/bash
export PYTHONPATH=/lib/python3.9/
python3.9 <full_script_path>/import_mantis.py

Then i try to execute the sh from jenkins job and i got this error :

Building in workspace /var/lib/jenkins/workspace/DEV_Update_Suivi_Installation
[DEV_Update_Suivi_Installation] $ /bin/sh -xe /tmp/jenkins13327687472776211165.sh
+ sh /opt/livraison/jenkins_wrapper/wrapper_import_mantis.sh
Traceback (most recent call last):
File "<path>/import_mantis.py", line 4, in    <module>
import django
ModuleNotFoundError: No module named 'django'
Build step 'Execute shell' marked build as failure
Finished: FAILURE

i think that i havent write the right things but i dont understand where the error is coming from.

I wrote the question there and i'm still searching solution.

Thanks in advance

本文标签: Error when running python script (from django project) from jenkinsStack Overflow