Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Flake8 don't save in cache pip

Hey,

In the bitbucket pipelines file I install the python dependences in the first step and it fails in the next step when I try to run flake8 command:

pipelines:
default:
- step:
name: Install dependencies
caches:
- pip
script:
- pip install -r requirements.txt

- step:
name: Test Flake8
caches:
- pip
script:
- flake8 -v api

In the second step I get the following error:

bash: flake8: command not found

1 answer

0 votes

Hello @sbarrio,

Welcome to the Community!

Pipeline steps are independent, each of them runs in a fresh Docker container. When you run pip install, it not only downloads the dependencies (cache might help here) but also installs it. E.g. puts flake8, for instance, somewhere on the PATH. So even if the cache works, flake8 won't be available in the next step, only in the next commands of the same script within one step.

In addition to this note that caches are saved on successful builds when the cache is empty. This means that when you update dependencies, the cache won't pick them up until it expires (this happens in 1 week from creation date). See this page for details.

Also, you shouldn't rely on caches in any way. They're meant to speed up the build but they shouldn't be required to run it, e.g. they can be emptied at any time.

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

2,119 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you