Can anyone point me towards an example configuration for managing/activating the virtualenv in a python 2.7 container? All of the example config files I found online (see snippet below) assume python 3.X and use the ‘venv’ module, which appears to not be available in python 2.7.
jobs:
build:
docker:
- image: circleci/python:2.7
steps:
- checkout
- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- run:
name: run tests
command: |
. venv/bin/activate
python manage.py test
Specifically:
‘python3 -m venv venv’ errors with 'python3: command not found’
and when I tried to replace python3 with python:
‘python2 -m venv venv’, errors with ‘No module named venv’
My use case is quite simple. I just need to be able to install some dependencies via pip, cache the virtualenv, and then run tests using those dependencies.