awspricing
awspricing copied to clipboard
MemoryError
Hi,
my test python code is:
import awspricing
ec2_offer = awspricing.offer('AmazonEC2')
p = ec2_offer.ondemand_hourly(
't2.micro',
operating_system='Linux',
region='eu-west-1'
)
print(p) # 0.0126
The output is this error message here:
[ec2-user@ip-10-0-1-224 awspricing]$ python lambda_function.py
Traceback (most recent call last):
File "lambda_function_1.py", line 3, in <module>
ec2_offer = awspricing.offer('AmazonEC2')
File "/usr/lib/python2.7/site-packages/awspricing/__init__.py", line 95, in offer
offer_data = _fetch_offer(service_name, version=version)
File "/usr/lib/python2.7/site-packages/awspricing/__init__.py", line 83, in _fetch_offer
offer = resp.json()
File "/usr/lib/python2.7/site-packages/requests/models.py", line 795, in json
return json.loads(self.content.decode(encoding), **kwargs)
File "/usr/lib64/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
MemoryError
Please help.
I faced the same issue and found 32-bit python was to blame. Try this and see if helps with your issue https://stackoverflow.com/questions/11283220/memory-error-in-python#answer-37726090