Memory Error on pip install (SOLVED)

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

Advertisements

4 thoughts on “Memory Error on pip install (SOLVED)

  1. Tané Tachyon

    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.

    Reply
  2. Brian Wylie

    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).

    Reply

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s