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

re-enabling pip cache for a user in the third world with potato internet "ERROR: pip cache commands can not function since cache is disabled." #12633

Closed
1 task done
physicsfreak963 opened this issue Apr 17, 2024 · 11 comments
Labels
C: cache Dealing with cache and files in it resolution: not a bug Determined as not a bug in pip

Comments

@physicsfreak963
Copy link

Description

the issue isn't new, but each thread has been closed because " the problem is too complex to resolve and the outcome isn't important", if an installation has multiple packages to install, it would be exponentially better to continue the installation starting the package that was mid installation when it get interrupted by slow internet or loss, starting downloading all over makes it nearly impossible to install because the internet wouldn't get any better by the time I restart the install, it will almost certainly get interrupted all over again, which feel like Sisyphus pushing the bolder

Expected behavior

No response

pip version

24.0

Python version

3.10

OS

ubuntu 22.04

How to Reproduce

reinstalling anything results in re-downloading files (i.e whl) but to receive the particular error, writing in terminal: pip cache dir

Output

ERROR: pip cache commands can not function since cache is disabled.

Code of Conduct

@physicsfreak963 physicsfreak963 added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Apr 17, 2024
@pfmoore pfmoore added type: feature request Request for a new feature state: awaiting PR Feature discussed, PR is needed and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Apr 17, 2024
@pfmoore
Copy link
Member

pfmoore commented Apr 17, 2024

Can you link to other such requests? I know this has been raised before, but the one I can find is #4796 which is not closed, it's simply waiting for someone to provide an implementation. I won't close this as a duplicate yet, in case there's something different that you're referring to here (you talk about the cache rather than resuming downloads) but as far as I can see, this is a duplicate.

If you're interested in providing a fix, that would be awesome - as you mention, this is something that hits a number of our users and it would be nice to be able to give a better experience for them.

@physicsfreak963
Copy link
Author

#11832 , #8142 . my issue isnt resuming the downloading of a single wheel or a package. in the issue that you provide is something I do many times. you must bare in mind I'm talking about redowloading a package that has been downloaded already in a previous attempted. to make things clear I will tell you what I'm doing right now, I'm trying to use tensorRT with my tensorflow, I'm trying to install it under different python versions on anaconda, now pip install tensorflow[and-cuda] download lots of packages, after downloading 2 gb worth of packages on my crappy net, when the download fail I would like the install to resume downloading starting with the package that failed, not all over again, now that was the case till some days ago when pip install redownload everything it downloaded on the previous attempt, and yesterday I found out that my cache is disabled. in short I want to enable my cache, I had to share too much because this has been brought up before, and the outcome isn't travail in compression with thye complexity of the solution, because under my circumstances, having a cache is so convenient, the cpmplexity is worth going through. I'm welling to redownload a single packages for a long install, but to haunt down all the packages for a single install (i.e tensorflow with its cuda package) like this is too much work . it's infuriating how condescending the replies are, like OK it's too complex, but it's moronic to close the issue because of so (this is'nt about tensorflow, please dont recommend solutions for that, this would be counter intuitive on so many levels, like why I deliberately trying pip install not using the tar file on their website, or the fact that this is an example for why this is an issue, not the issue itself )

@pfmoore
Copy link
Member

pfmoore commented Apr 18, 2024

OK, so pip's cache should do what you want here. The linked issues were both cases where users had done something that caused the cache to be disabled, and the fix was to sort that out so the cache was re-enabled.

If the cache isn't working for you (the default behaviour of pip is to use the cache) then that's a configuration problem. You need to explain what you've done before anyone can help you solve the issue. While I understand the frustration of things not working, we'll need a clear description of how to reproduce the problem you're having (ideally from a fresh install of pip, although I appreciate that may not be possible if you don't know how you got in this state) in order to help.

now that was the case till some days ago

So what happened at that point, because that's almost certainly what triggered the problem.

yesterday I found out that my cache is disabled

What are you seeing that tells you the cache is disabled.

it's infuriating how condescending the replies are, like OK it's too complex, but it's moronic to close the issue

Don't be insulting to people who are trying to help you. If that's how you feel about me spending time trying to make sense of your comments and provide some useful response, then I guess my input isn't appreciated and I'll go and do something that doesn't involve people insulting me.

@pradyunsg
Copy link
Member

pradyunsg commented Apr 19, 2024

@physicsfreak963 Please run pip config debug and post the output of that.

@ichard26 ichard26 added the C: cache Dealing with cache and files in it label Apr 19, 2024
@physicsfreak963
Copy link
Author

@pradyunsg

env_var:
env:
global:
/etc/xdg/xdg-ubuntu/pip/pip.conf, exists: False
/etc/xdg/pip/pip.conf, exists: False
/etc/pip.conf, exists: False
site:
/usr/pip.conf, exists: False
user:
/home/homam/.pip/pip.conf, exists: True
global.no-cache-dir: true
global.index-url: https://pypi.org/simple
global.extra-index-url:
https://pypi.ngc.nvidia.com
global.trusted-host:
pypi.ngc.nvidia.com
/home/homam/.config/pip/pip.conf, exists: True
global.no-cache-dir: true
global.index-url: https://pypi.org/simple
global.extra-index-url:
https://pypi.ngc.nvidia.com
global.trusted-host:
pypi.ngc.nvidia.com

@physicsfreak963
Copy link
Author

@pfmoore my friend I was referring to the people closing the issues I mentioned on my comment, it might be ill mannered to call their action moronic but I want to make it clear, I'm not referring to anyone trying to help here, I really do appreciate all the help I recieve. Their actions are midely enraging, closing an issue because they made the assessment that the issue is too complex to be solved in compression with the out come, which is something subjective, it's up to the user and the user's situation to determine that. Once again I have nothing but appreciation for you and anyone helping. Now that's out of the way, I was trying tweak with tensorflow installation (at first trying to enable on gpu then trying to enable TensorRT), now I don't remember changing anything with pip configuration, and I have just checked my bash history, the only thing I can think might be related is pip install --upgrade pip and pip install --upgrade setuptools pip, I dont particularly think this might have caused the problem but seeing my history these are the only option that can be connected. I totally agree this had to be changed somehow, but I can't see how yet. I dont mind sharing my bash history (at least between the points where I'm sure this wasnt a problem to the point where this became a problem) but it's alot of lines

@pradyunsg
Copy link
Member

/home/homam/.config/pip/pip.conf, exists: True

Open this file and remove the line that disables the cache (the line with no-cache-dir).

You have set this manually at some point.

@pradyunsg pradyunsg added resolution: not a bug Determined as not a bug in pip and removed state: awaiting PR Feature discussed, PR is needed type: feature request Request for a new feature labels Apr 20, 2024
@pradyunsg
Copy link
Member

pradyunsg commented Apr 20, 2024

Closing this since the above guidance should resolve the issue for @physicsfreak963. This issue is not complex, pip is respecting the configuration that you have set at some point in the configuration file for it.

If the guidance does not resolve the issue, @physicsfreak963 please politely say so and provide the complete output of running pip install [some package] --debug showing the behaviour and we'll reopen this issue.

If you are rude towards me or any other maintainer, this issue will be locked.

@physicsfreak963
Copy link
Author

@pradyunsg I'm just adding that you need to apply this change to all config files mentioned in the config files if someone stumbled on this issue in the future
On a side note, if you check issues #11832 and #842 you can see how people have had the same issue and people closing it becuase "it's too complex to be solved"

@IcyFeather233
Copy link

/home/homam/.config/pip/pip.conf, exists: True

Open this file and remove the line that disables the cache (the line with no-cache-dir).

You have set this manually at some point.

Hi @pradyunsg if I use conda env, where can I find a conf file like /home/username/.config/pip/pip.conf, I find there is no /home/username/.config/pip/ dir in my server.

@pfmoore
Copy link
Member

pfmoore commented May 10, 2024

@IcyFeather233 Generally, we wouldn't recommend mixing pip and conda, but if you want to, then pip config debug should show you where your pip config files are.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2024
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 resolution: not a bug Determined as not a bug in pip
Projects
None yet
Development

No branches or pull requests

5 participants