Memory Error on pip install (SOLVED)

comments 6

Memory Error when using pip install on Python can emerge both from command line or from a IDE like PyCharm, usually when the package size is big.

When you try to install a python package with pip install packagename but it fails due to a Memory Error, you can fix it in this way:

  1. Go to your console
  2. Optional: if your application is into a a virtual environment activate it
  3. pip install packagename --no-cache-dir

The package will now be downloaded with the cache disabled (see pip –help).

Thanks to David Wolever



  1. Thanks for posting that — I kept getting a memory error while trying python -m pip install kivy.deps.gstreamer and it was quite frustrating, but adding the –no-cache-dir fixed it.

    • At the time I was using Kivy and I was stuck by this error too. Thank you for commenting and happy python coding!

  2. Brian Wylie says

    The described solution does work and might be the right thing to do in some cases. For my case I simply needed to bump up the RAM on my VM and the MemoryError was gone and it was probably the better solution (for my case).

  3. Pingback: pip install時にMemory Errorが出た時の対処法 | IT技術情報局

  4. gozie says

    I had a challenging MemoryError exception while trying to install PySpark on a Virtual Hosted Ubuntu machine, but adding the –no -cache-dir option worked like a charm. Thanks

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s