How to upgrade Python version in CircleCI configuration file?

Hi there,

I am trying to deploy project on AWS EBS using CircleCI. It was deploying till tomorrow. But today CircleCI is throwing an error in “Installing deployment dependencies” Step. I am mentioning error below.
Error:
pyrsistent requires Python ‘>=3.5’ but the running Python is 2.7.13
Exited with code exit status 1
CircleCI received exit code 1

I am mentioning here config.yml Installing dependencies step below

Install software required to run EB deployer

  - run:
      name: Installing deployment dependencies
      working_directory: ~/repo
      command: |
        sudo apt-get -y -qq update
        sudo apt-get install python-pip python-dev build-essential
        sudo pip install "urllib3<1.23,>=1.21.1" awsebcli --upgrade
        sudo pip install awscli

Please help me on this.

Thank you!

It is resolved by adding python3 like sudo apt-get install python3-pip python3-dev build-essential

I’m not sure which executor you’re using, but there’s some additional approaches to this if you’re using the docker executor. You can save time by pre-installing tools/languages in a custom docker image and using that custom image to run your job. You also have have our pre-built convenience images that allow you to select languages and tools that come pre-installed. If you’re on the machine executor it’s possible to caching somme tools/binaries to help speed up provisioning, but it should already have many languages pre-installed.

You can learn more about ways to optimize your pipelines on our developer portal.