Python CGI Script "Cannot allocate memory" Import Error
<p>I have a simple CGI script on a shared 64bit Ubuntu hosting environment.</p>

<pre><code>#!/kunden/homepages/14/d156645139/htdocs/htdocs/anaconda2/bin/python
# -*- coding: UTF-8 -*-

import sys
import cgi
import cgitb
cgitb.enable()
import numpy
from pandas_datareader.yahoo.daily import YahooDailyReader
</code></pre>

<p>When I attempt to run the script I receive the following error:</p>

<pre><code> /kunden/homepages/14/d156645139/htdocs/finance/bin/py/test.py in ()
      6 import cgitb
      7 cgitb.enable()
=&gt;    8 from pandas_datareader.yahoo.daily import YahooDailyReader
      9 import datetime as dt
     10 import numpy as np
pandas_datareader undefined, YahooDailyReader undefined
 /kunden/homepages/14/d156645139/htdocs/anaconda2/lib/python2.7/site-packages/pandas_datareader/yahoo/daily.py in ()
      2 
      3 
      4 class YahooDailyReader(_DailyBaseReader):
      5 
      6     """
pandas_datareader undefined, _DailyBaseReader undefined
 /kunden/homepages/14/d156645139/htdocs/anaconda2/lib/python2.7/site-packages/pandas_datareader/base.py in ()
      7 from requests_file import FileAdapter
      8 
=&gt;    9 from pandas import to_datetime
     10 import pandas.compat as compat
     11 from pandas.core.common import PandasError, is_number
pandas undefined, to_datetime undefined
 /kunden/homepages/14/d156645139/htdocs/anaconda2/lib/python2.7/site-packages/pandas/__init__.py in ()
     35 
     36 # let init-time option registration happen
=&gt;   37 import pandas.core.config_init
     38 
     39 from pandas.core.api import *
pandas undefined
 /kunden/homepages/14/d156645139/htdocs/anaconda2/lib/python2.7/site-packages/pandas/core/config_init.py in ()
     16                                 is_one_of_factory, get_default_val,
     17                                 is_callable)
=&gt;   18 from pandas.formats.format import detect_console_encoding
     19 
     20 #
pandas undefined, detect_console_encoding undefined
 /kunden/homepages/14/d156645139/htdocs/anaconda2/lib/python2.7/site-packages/pandas/formats/format.py in ()
     19 import pandas.lib as lib
     20 from pandas.tslib import iNaT, Timestamp, Timedelta, format_array_from_datetime
=&gt;   21 from pandas.tseries.index import DatetimeIndex
     22 from pandas.tseries.period import PeriodIndex
     23 import pandas as pd
pandas undefined, DatetimeIndex undefined
 /kunden/homepages/14/d156645139/htdocs/anaconda2/lib/python2.7/site-packages/pandas/tseries/index.py in ()
&lt;type 'exceptions.ImportError'&gt;: /kunden/homepages/14/d156645139/htdocs/anaconda2/lib/python2.7/site-packages/pandas/_period.so: failed to map segment from shared object: Cannot allocate memory 
      args = ('/kunden/homepages/14/d156645139/htdocs/anaconda2...egment from shared object: Cannot allocate memory',) 
      message = '/kunden/homepages/14/d156645139/htdocs/anaconda2...egment from shared object: Cannot allocate memory'
</code></pre>

<p>How can I trace the source of the memory error? For example, is there a way to understand the memory limits or even increase?</p>

<p>I was able to increase the RAM of the machine to a guaranteed 2GB which solved the problem.</p>

python pandas