Python CGI Script "Cannot allocate memory" Import Error
Question: I have a simple CGI script on a shared 64bit Ubuntu hosting environment.

    
    
    #!/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
    

When I attempt to run the script I receive the following error:

    
    
     /kunden/homepages/14/d156645139/htdocs/finance/bin/py/test.py in ()
          6 import cgitb
          7 cgitb.enable()
    =>    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 
    =>    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
    =>   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)
    =>   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
    =>   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 ()
    <type 'exceptions.ImportError'>: /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'
    

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


Answer: I was able to increase the RAM of the machine to a guaranteed 2GB which solved
the problem.

