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

Why pip install don't cache packages? #7890

Closed
hongyi-zhao opened this issue Mar 24, 2020 · 20 comments
Closed

Why pip install don't cache packages? #7890

hongyi-zhao opened this issue Mar 24, 2020 · 20 comments
Labels
C: cache Dealing with cache and files in it type: support User Support

Comments

@hongyi-zhao
Copy link

Hi,

With the following environment:

$ pip --version
pip 20.0.2 from /home/werner/.pyenv/versions/3.8.1/envs/test1/lib/python3.8/site-packages/pip (python 3.8)

Tested with the following steps:

(test1) werner@ubuntu-01:~$ pip install six
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting six
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: six
Successfully installed six-1.14.0

(test1) werner@ubuntu-01:~$ pip uninstall six
Found existing installation: six 1.14.0
Uninstalling six-1.14.0:
  Would remove:
    /home/werner/.repo/github.com/pyenv/versions/linux-x86_64/3.8.1/envs/test1/lib/python3.8/site-packages/six-1.14.0.dist-info/*
    /home/werner/.repo/github.com/pyenv/versions/linux-x86_64/3.8.1/envs/test1/lib/python3.8/site-packages/six.py
Proceed (y/n)? y
  Successfully uninstalled six-1.14.0

(test1) werner@ubuntu-01:~$ pip install six
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting six
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: six
Successfully installed six-1.14.0

As you can see, when I run ``pip install'' for the second time, it will re-downloading the package instead of using the local cache.

And I also cannot find the downloaded package at the following location:

(test1) werner@ubuntu-01:~$ find ~/.cache/pip -type f -name 'six-1.14.0-py2.py3-none-any.whl'
(test1) werner@ubuntu-01:~$ 

Any hints?

Regards

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Mar 24, 2020
@NoahGorny
Copy link
Contributor

I suspect it has something to do with your index being insecure due to bad certs/old TLS.
Currently pip does not cache from insecure origins even if they are specified as "trusted hosts"

See #7847 and the PR I made to solve it #7885
Feel free to voice your opinion on the matter 😄

@pradyunsg pradyunsg added C: cache Dealing with cache and files in it state: needs eyes Needs a maintainer/triager to take a closer look type: bug A confirmed bug or unintended behavior type: support User Support labels May 25, 2020
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label May 25, 2020
@duckinator

This comment has been minimized.

@pradyunsg

This comment has been minimized.

@uranusjr uranusjr added the S: awaiting response Waiting for a response/more information label Sep 24, 2021
@duckinator

This comment has been minimized.

@no-response
Copy link

no-response bot commented Oct 9, 2021

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this as completed Oct 9, 2021
@duckinator
Copy link
Contributor

@pradyunsg can this be reopened? I've had the same problem and included the information that was asked for.

@pradyunsg pradyunsg reopened this Oct 9, 2021
@pradyunsg pradyunsg removed the S: awaiting response Waiting for a response/more information label Oct 9, 2021
@pradyunsg
Copy link
Member

Bot was looking for a response from someone else. :)

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label Oct 9, 2021
@moltar

This comment has been minimized.

@uranusjr

This comment has been minimized.

@uranusjr

This comment has been minimized.

@uranusjr uranusjr added S: awaiting response Waiting for a response/more information state: needs reproducer Need to reproduce issue and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged state: needs eyes Needs a maintainer/triager to take a closer look labels Oct 16, 2021
@moltar

This comment has been minimized.

@moltar

This comment has been minimized.

@pradyunsg

This comment has been minimized.

@moltar

This comment has been minimized.

@moltar

This comment has been minimized.

@Fatal1ty

This comment has been minimized.

@uranusjr

This comment has been minimized.

@moltar
Copy link

moltar commented Oct 17, 2021

Uh, of course not. Cache happens in the container, and two different runs each starts from a fresh environment without cache, so they are the same. To actually compare the cached performance, you need to run pip install --force-reinstall twice in the same environment (I added a few -q to make the output more readable):

That's exactly what I did. I ran it in the same container.

@no-response
Copy link

no-response bot commented Oct 31, 2021

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this as completed Oct 31, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2021
@pypa pypa unlocked this conversation Jul 26, 2022
@pradyunsg pradyunsg removed S: awaiting response Waiting for a response/more information state: needs reproducer Need to reproduce issue labels Jul 26, 2022
@pypa pypa locked as resolved and limited conversation to collaborators Jul 26, 2022
@pradyunsg
Copy link
Member

Unlocked and relocked, to add back a cross-reference to the issue that contained sufficient context and whose author contributed a fix for this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: cache Dealing with cache and files in it type: support User Support
Projects
None yet
Development

No branches or pull requests

7 participants