Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pip cache is not found" (/home/runner/.cache/pip) #831

Open
2 of 5 tasks
till opened this issue Mar 19, 2024 · 7 comments
Open
2 of 5 tasks

"pip cache is not found" (/home/runner/.cache/pip) #831

till opened this issue Mar 19, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@till
Copy link

till commented Mar 19, 2024

Maybe related, but not really: #816


Description:

I expect this action to create the directory for the pip cache, when I use cache: pip, but instead it displays this message.

Action version:

v5

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

I used 3.7.17

Repro steps:

    - uses: actions/setup-python@v5
      with:
        python-version: '3.7.17'
        cache: 'pip'

Expected behavior:

Action creates the cache directory for the user (probably in /home/runner/.cache/pip).

Actual behavior:

It does not create the cache folder. Also, when I run this locally (with act), the post step fails because that.

@till till added bug Something isn't working needs triage labels Mar 19, 2024
@HarithaVattikuti
Copy link
Contributor

Hello @till
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

@aparnajyothi-y
Copy link

Hello @till, Thank you once again for creating this issue.
Setup-python action sets up a Python environment and it doesn't create a pip cache directory by default. The pip cache directory is created when pip installs a package and needs to cache it.
We tested the same by adding the pip installation job and pip cache file generated in the /home/runner/.cache/pip location and cached the pip installed packages. Also we are able to reproduce the error without adding the pip installation and pip hasn't cached any packages yet, so the cache directory doesn't exist.
Please find the screenshots for reference.

     - uses: actions/setup-python@v5
   with:
     python-version: '3.7.17'
     cache: 'pip'
 - name: Install dependencies
   run: |
     python -m pip install --upgrade pip
     pip install -r requirements.txt
image
 - uses: actions/setup-python@v5
   with:
     python-version: '3.7.17'
     cache: 'pip'
image

Please update the workflow as per the above and confirm.

@till
Copy link
Author

till commented Apr 3, 2024

@aparnajyothi-y what exactly are you asking me to do? Add a pip install something to confirm it gets created?

@aparnajyothi-y aparnajyothi-y self-assigned this Apr 3, 2024
@aparnajyothi-y
Copy link

aparnajyothi-y commented Apr 3, 2024

Hello @till, Add a job like below to your existing workflow to install dependency packages using pip to confirm.

  • name: Install dependencies
    run: |
    python -m pip install --upgrade pip
    pip install -r requirements.txt

@till
Copy link
Author

till commented Apr 3, 2024

@aparnajyothi-y I won't get to that. I hope you don't need me to confirm.

The second bug (it fails the post step) is still there.

Somewhere in here:
https://github.com/actions/setup-python/blob/main/src/cache-save.ts

@aparnajyothi-y
Copy link

aparnajyothi-y commented Apr 15, 2024

Hello @till, we tried to reproduce the second issue but unfortunately we are not able to reproduce and the post step is successful. Please find the screenshot for reference.
Could you please share the repro link and the error that you are seeing in the post setup failure to further investigate.
image

@aparnajyothi-y
Copy link

Hello @till, Could you please share the repro link and the error that you are seeing in the post setup failure to further investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants