[{"data":1,"prerenderedAt":259},["ShallowReactive",2],{"blog-article-\u002Fblog\u002Fclean-pip-cache":3},{"id":4,"title":5,"author":6,"body":7,"category":242,"cover":243,"coverAlt":244,"description":245,"draft":246,"extension":247,"meta":248,"navigation":249,"path":250,"publishedAt":251,"seo":252,"stem":253,"tags":254,"translationKey":257,"updatedAt":251,"__hash__":258},"articles_en\u002Fblog\u002Fclean-pip-cache.md","How to Clear the pip Cache Without Removing Installed Packages","Harry",{"type":8,"value":9,"toc":236},"minimark",[10,14,21,30,35,44,47,58,65,69,76,87,90,106,123,126,130,133,154,157,160,169,177,196,200,207,225,232],[11,12,13],"p",{},"Installing Python tools or local AI apps can leave more on your drive than the environment you need to run them. pip also keeps a cache of downloaded files and built packages. Can you clear that without breaking your setup?",[11,15,16,20],{},[17,18,19],"strong",{},"Yes. Clearing pip's cache doesn't uninstall your Python packages or delete your project's virtual environment."," The trade-off comes with future installations: pip may need to download files or build packages again, which takes extra time.",[11,22,23,24,29],{},"If you'd rather not dig through hidden folders, MangoDisk's ",[25,26,28],"a",{"href":27},"\u002Fdocs\u002Ffeatures\u002Fdeep-clean","Deep Cleanup"," shows pip's cache alongside other supported caches. Compare their sizes and choose what to remove, without deleting an environment you still use.",[31,32,34],"h2",{"id":33},"the-cache-isnt-your-installed-environment","The cache isn't your installed environment",[11,36,37,38],{},"pip caches downloads and locally built wheels so it can reuse them later. The packages your project runs are installed separately, in a Python environment. Removing the cache is not the same as uninstalling those packages. ",[25,39,43],{"href":40,"rel":41},"https:\u002F\u002Fpip.pypa.io\u002Fen\u002Fstable\u002Ftopics\u002Fcaching\u002F",[42],"nofollow","pip's caching documentation",[11,45,46],{},"On Windows, the default cache location is:",[48,49,55],"pre",{"className":50,"code":52,"language":53,"meta":54},[51],"language-text","%LocalAppData%\\pip\\Cache\n","text","",[56,57,52],"code",{"__ignoreMap":54},[11,59,60,61,64],{},"That's separate from your project and its ",[56,62,63],{},".venv"," folder. Don't treat a virtual environment as another cache to clear: deleting it can leave you needing to reinstall the project's dependencies.",[31,66,68],{"id":67},"check-pip-and-other-caches-together-in-mangodisk","Check pip and other caches together in MangoDisk",[11,70,71,72,75],{},"For pip alone, a terminal command does the job. MangoDisk is useful when you want to ",[17,73,74],{},"compare several caches, see their paths, and choose what to clean in one place",". You don't have to look up a separate cleanup command for every tool you've installed.",[11,77,78],{},[79,80],"img",{"alt":81,"decoding":82,"height":83,"loading":84,"src":85,"width":86},"MangoDisk Deep Cleanup on Windows, showing cache categories, disk usage, and selected items","async",1171,"lazy","https:\u002F\u002Fassets.mangodisk.app\u002Fimages\u002Fscreenshots\u002Fwindows\u002Fen\u002Flight-01-deep-cleanup.jpg",1746,[11,88,89],{},"On Windows:",[91,92,93,100,103],"ol",{},[94,95,96,97,99],"li",{},"Open ",[17,98,28],{}," and run a standard scan.",[94,101,102],{},"Find the pip cache entry and expand it to check its size and path. It isn't selected by default; select it if you want to remove it.",[94,104,105],{},"To clear only pip's cache, deselect the other entries, then review the cleanup confirmation before proceeding.",[11,107,108,109,114,115,117,118,122],{},"A scan doesn't delete files. MangoDisk's ",[25,110,113],{"href":111,"rel":112},"https:\u002F\u002Fgithub.com\u002Fharry0703\u002FMangoDisk\u002Fblob\u002Fmain\u002Fsrc-tauri\u002Fcrates\u002Fmangodisk-core\u002Frules\u002Ffilesystem\u002Fwindows\u002Fdevelopment\u002Fdev.pip-cache.toml",[42],"Windows pip rule"," targets the default cache folder—not your project's ",[56,116,63],{}," or packages installed elsewhere. See the ",[25,119,121],{"href":120},"\u002Fdocs\u002Fsafety","cleanup safety guide"," for how to review a selection.",[11,124,125],{},"If you've changed pip's cache location, check the actual path with the command below rather than assuming it's in the default folder.",[31,127,129],{"id":128},"using-pip-cache-purge","Using pip cache purge",[11,131,132],{},"In a Windows terminal, first run:",[48,134,138],{"className":135,"code":136,"language":137,"meta":54,"style":54},"language-powershell shiki shiki-themes github-light github-dark","py -m pip cache dir\npy -m pip cache info\n","powershell",[56,139,140,148],{"__ignoreMap":54},[141,142,145],"span",{"class":143,"line":144},"line",1,[141,146,147],{},"py -m pip cache dir\n",[141,149,151],{"class":143,"line":150},2,[141,152,153],{},"py -m pip cache info\n",[11,155,156],{},"The first command prints the configured cache path; the second shows its size. A small cache may not be worth clearing. A large one is a more useful place to start, especially if you won't be reinstalling those packages soon.",[11,158,159],{},"Wait for any active installation or download to finish. Once you've checked the cache directory, run:",[48,161,163],{"className":135,"code":162,"language":137,"meta":54,"style":54},"py -m pip cache purge\n",[56,164,165],{"__ignoreMap":54},[141,166,167],{"class":143,"line":144},[141,168,162],{},[11,170,171,172],{},"This deletes pip's HTTP and wheel caches directly, without sending them to the Recycle Bin. Installed packages stay in place, but a later installation may need to download or build them again. ",[25,173,176],{"href":174,"rel":175},"https:\u002F\u002Fpip.pypa.io\u002Fen\u002Fstable\u002Fcli\u002Fpip_cache\u002F",[42],"pip cache command reference",[11,178,179,180,183,184,187,188,191,192,195],{},"If you normally launch Python with ",[56,181,182],{},"python"," or ",[56,185,186],{},"python3",", use that instead of ",[56,189,190],{},"py",". The same ",[56,193,194],{},"-m pip cache"," commands work on macOS and Linux: check the path and size before clearing anything.",[31,197,199],{"id":198},"still-short-on-space","Still short on space?",[11,201,202,203,206],{},"pip's cache is only part of the picture. Project environments, downloaded models, and personal files won't disappear when you run ",[56,204,205],{},"pip cache purge","—and they shouldn't be cleared as if they were all temporary files.",[11,208,209,210,214,215,219,220,224],{},"Use MangoDisk's ",[25,211,213],{"href":212},"\u002Fdocs\u002Ffeatures\u002Fdisk-analysis","Disk Space Analysis"," to find the larger folders. That helps you tell whether the space is going to caches or to an old project or model you no longer need. If you also use Node.js or Rust, check the guides to ",[25,216,218],{"href":217},"\u002Fblog\u002Fclean-npm-cache","npm cache cleanup"," and ",[25,221,223],{"href":222},"\u002Fblog\u002Fcargo-cache-vs-target-folder","Cargo caches versus target folders","; each has a different cleanup scope.",[11,226,227,231],{},[25,228,230],{"href":229},"\u002F","Download MangoDisk"," to review scattered caches in one place. Free and open source, with no signup or login. You choose what to remove.",[233,234,235],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":54,"searchDepth":150,"depth":150,"links":237},[238,239,240,241],{"id":33,"depth":150,"text":34},{"id":67,"depth":150,"text":68},{"id":128,"depth":150,"text":129},{"id":198,"depth":150,"text":199},"Developer Disk Cleanup","\u002Fimages\u002Fblog\u002Fclean-pip-cache.webp","An orange brush clears spare package blocks from a cache tray while a separate project folder stays intact","Check how much space pip's cache uses, then clear it with MangoDisk or pip cache purge. Keep installed packages and virtual environments intact.",false,"md",{},true,"\u002Fblog\u002Fclean-pip-cache","2026-09-29T14:00:00+08:00",{"title":5,"description":245},"blog\u002Fclean-pip-cache",[205,255,256],"Python cache","clear pip cache","article-clean-pip-cache","g5bR9UyoD_g05RNfl6RM_Sgvuudg4sQCfR12o9ySKB0",1790663627455]