question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pipenv unlimited cache size

See original GitHub issue

Issue description

Huge cache size (at ~/.cache/pipenv)

Expected result

Cache to contain only the most recently used packages.

Actual result

Cache seems to keep growing in size with no restrictions (16 GB), while Pip cache on the other hand is < 2GB

Steps to replicate

du -ah ~/.cache/pipenv --max-depth=1 | sort -hr 16G /home/pc/.cache/pipenv/http 16G /home/pc/.cache/pipenv 185M /home/pc/.cache/pipenv/wheels 74M /home/pc/.cache/pipenv/hash-cache 12M /home/pc/.cache/pipenv/pkgs 16K /home/pc/.cache/pipenv/selfcheck.json 16K /home/pc/.cache/pipenv/depcache-py3.6.json 16K /home/pc/.cache/pipenv/depcache-py3.5.json 12K /home/pc/.cache/pipenv/depcache-py3.7.json

du -ah ~/.cache/pip --max-depth=1 | sort -hr 1.9G /home/pc/.cache/pip 1.8G /home/pc/.cache/pip/http 124M /home/pc/.cache/pip/wheels 16K /home/pc/.cache/pip/selfcheck.json


$ pipenv --support

Pipenv version: '2018.11.26'

Pipenv location: '/home/pc/.local/lib/python3.6/site-packages/pipenv'

Python location: '/usr/bin/python3.6'

Python installations found:

  • 3.7.0: /usr/local/bin/python3.7m
  • 3.7.0: /usr/local/bin/python3.7
  • 3.6.6: /usr/bin/python3.6m
  • 3.6.6: /usr/bin/python3.6
  • 3.5.2: /usr/bin/python3.5m
  • 3.5.2: /usr/bin/python3.5
  • 2.7.12: /usr/bin/python2.7
  • 2.5.6: /usr/bin/python2.5

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.6',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.15.0-46-generic',
 'platform_system': 'Linux',
 'platform_version': '#49~16.04.1-Ubuntu SMP Tue Feb 12 17:45:24 UTC 2019',
 'python_full_version': '3.6.6',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • XDG_SEAT
  • XDG_SESSION_ID
  • DISPLAY
  • UPSTART_JOB
  • JOB
  • COLORTERM
  • GNOME_KEYRING_CONTROL
  • GNOME_DESKTOP_SESSION_ID
  • DEFAULTS_PATH
  • QT_QPA_PLATFORMTHEME
  • LOGNAME
  • INSTANCE
  • JAVA_HOME
  • SHELL
  • PATH
  • IM_CONFIG_PHASE
  • QT4_IM_MODULE
  • CLUTTER_IM_MODULE
  • XMODIFIERS
  • XDG_SESSION_PATH
  • J2REDIR
  • SSH_AUTH_SOCK
  • UPSTART_EVENTS
  • XDG_SESSION_DESKTOP
  • GDMSESSION
  • XAUTHORITY
  • QT_IM_MODULE
  • XDG_CONFIG_DIRS
  • MANDATORY_PATH
  • UPSTART_SESSION
  • DESKTOP_SESSION
  • XDG_RUNTIME_DIR
  • GTK_IM_MODULE
  • IBUS_DISABLE_SNOOPER
  • GTK_MODULES
  • PWD
  • USER
  • DERBY_HOME
  • UPSTART_INSTANCE
  • TERMINATOR_UUID
  • HOME
  • QT_ACCESSIBILITY
  • ORBIT_SOCKETDIR
  • XDG_SEAT_PATH
  • XDG_DATA_DIRS
  • LANGUAGE
  • COMPIZ_CONFIG_PROFILE
  • XDG_GREETER_DATA_DIR
  • LANG
  • GTK2_MODULES
  • GPG_AGENT_INFO
  • SHLVL
  • WINDOWID
  • J2SDKDIR
  • XDG_VTNR
  • GDM_LANG
  • SESSIONTYPE
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_CURRENT_DESKTOP
  • XDG_SESSION_TYPE
  • GNOME_KEYRING_PID
  • QT_LINUX_ACCESSIBILITY_ALWAYS_ON
  • TERM
  • OLDPWD
  • ZSH
  • PAGER
  • LESS
  • LSCOLORS
  • LS_COLORS
  • LC_CTYPE
  • ANDROID_HOME
  • _
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/pc/bin:/home/pc/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/pc/Android/Sdk/platform-tools:/home/pc/Android/Sdk/tools:/home/pc/Android/Sdk/build-tools/23.0.2/:/home/pc/Downloads/android-sdk-linux/platform-tools:/home/pc/Downloads/android-sdk-linux/tools
  • SHELL: /usr/bin/zsh
  • LANG: en_US.UTF-8
  • PWD: /home/pc

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:34
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
m-spyratoscommented, Apr 8, 2020

@uranusjr Why would this be a low priority enhancement? I’m new to Python here and I decided to use pipenv. Next day my hard drive was gone with 15GB of it occupied by these cache files.

If this is not going to be fixed any time soon, then a warning on the top of the README file ought to be placed.

8reactions
abdelrahman-tcommented, Apr 9, 2020

I use these three lines as a replacement for pipenv using pip-tools

create virtual environment

python -m venv venv && source venv/bin/activate

pin requirements

pip-compile requirements.in --generate-hashes

install pinned requirements

pip install -r requirements.txt

Project seems to be dead, Why this project is recomended at https://packaging.python.org/guides/tool-recommendations/ is truely beyond me!

Read more comments on GitHub >

github_iconTop Results From Across the Web

pipenv Documentation - Read the Docs
PIPENV_CACHE_DIR. Location for Pipenv to store it's package cache. Default is to use appdir's user cache directory. PIPENV_CUSTOM_VENV_NAME. Tells Pipenv ...
Read more >
Pipenv: A Guide to the New Python Packaging Tool
Pipenv is a packaging tool for Python that solves some common problems associated with the typical workflow using pip, virtualenv, and the good...
Read more >
Advanced Usage of Pipenv - Read the Docs
You can force Pipenv to use a different cache location by setting the environment variable PIPENV_CACHE_DIR to the location you wish. This is...
Read more >
cachepy · PyPI
Standard cache constructors are used to initialize caches of unlimited capacity. There are also caches of limited capacity. Such caches are initialized by ......
Read more >
Pipenv/docker best practices? : r/Python - Reddit
I'm trying to set up build/deploy infrastructure for a pipenv project ... caching mechanism isn't Python-aware, so it reruns the pipenv ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found