I'm trying to cache the python dependencies of my project. To do that, I have this configuration in my workflow:
      - uses: actions/cache@v2
        id: cache
        with:
          path: ~/.cache/pip
          key: pip-${{ runner.os }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements_dev.txt') }}
          restore-keys: pip-${{ runner.os }}
      - name: Install apt dependencies
        run: |
          sudo apt-get update
          sudo apt-get install gdal-bin
      - name: Install dependencies
        if: steps.cache.outputs.cache-hit != 'true'
        run: |
          pip install --upgrade pip==9.0.1
          pip install -r requirements.txt
          pip install -r requirements_dev.txt
This works, by 'works' I mean that it loads the cache and skip the 'Install dependencies step' and it restores the ~/.cache/pip directory. The problem is that when I try to run the tests, the following error appears:
  File "manage.py", line 7, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
Error: Process completed with exit code 1.
Am I caching the incorrect directory? Or what am I doing wrong?
Note: this project is using python2.7 on Ubuntu 16.04
 
    