Closed jdstrand closed 2 months ago
I had a similar issue with the Python 3.10 base image. I invalidated the CircleCI cache because it referenced an non-existent version of Python.
To make it easier to invalidate the cache, I configure the cache key with an environment variable so that I do not have to commit a change to the config.yml
file. For example:
key: deps-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ checksum "collectors/combined-requirements.txt" }}
Ah, yes, I was wondering if it had something to do with the cache. Thanks for the tip! I'm going to close this as it has to do with my setup of the cache.
In case it is useful to others, I decided to fix this for my use case in the following way:
commands:
create_concatenated_requirements:
description: "Concatenate all requirements*.txt files into a single file for checksumming."
steps:
- run:
name: "Combine requirements*.txt files to a single file"
command: |
cat ./collectors/requirements*.txt > ./collectors/combined-requirements.txt
# detect if the python (micro) version changes
echo "# python3 --version: $(python3 --version)" >> ./collectors/combined-requirements.txt
# for debugging
#echo "$ cat ./collectors/combined-requirements.txt"
#cat ./collectors/combined-requirements.txt
This works because in my case I am using the checksum of ./collectors/combined-requirements.txt
as part of my key (ie, key: deps1.0-{{ .Branch }}-{{ checksum "collectors/combined-requirements.txt" }}
) and while I am not using ./collectors/combined-requirements.txt
with pip
, requirements files support comments so the file remains compatible with it.
Describe the bug My python CI jobs started failing with
bad interpreter: No such file or directory
when usingimage: cimg/python:3.8
. I see from https://circleci.com/developer/images/image/cimg/python that 3.8 was recently updated to 3.8.20. Specifyingimage: cimg/python:3.8.19
resolves the issue.Error output for
Install python components for prod
step:To Reproduce Please provide steps to reproduce the behavior, such as a sample job or config file.
Example job file:
make install-venv
does:Expected behavior Normally, this all works fine and tests are run.
Workarounds Are there any current workarounds for this bug that can be used currently?
Use:
Screenshots and Build Links If possible, add screenshots and links to jobs to help explain your problem.
Additional context Add any other context about the problem here.