0

I am configuring a jenkins project and in build environment step; I have below commands to execute from shell:

cd /Users/admin/jenkins
pip install --upgrade pip
pip install -r requirements.txt --user
python ./script.py

But it's failing with

pip: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE

Locally I have tested script.py and it runs fine, perhaps pip and required modules are installed. But running into issues when setting up same as jenkins job to automate the script. Any alternates/suggestions for the pip install cmd ?

1
  • 1
    If jenkins runs on the same machine you're executing the script locally, then jenkins will have a different environment from what you have. Add a line echo $PATH in jenkins script, run basename $(command -v pip) and check whether the last directory is included in PATH on jenkins run. Commented Dec 5, 2018 at 19:23

1 Answer 1

2

It looks like pip is not installed in the server/environment where jenkins is running. This is not an issue with script.py. You need to install pip. This needs to be done only once though when you set up jenkins, no need to add it to the job configuration.

Sign up to request clarification or add additional context in comments.

1 Comment

pip install --upgrade pip won't work if pip isn't already installed. Have you tried following the steps here to install pip? pip.pypa.io/en/stable/installing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.