python - Issues with Pickle when using amazon vm -


i running code on amazon's vm work , trying load pickle file have saved on s3 bucket. when run code, keep coming across import error: no module named decimal. tried adding "from decimal import decimal" on top of code without success. it's complaining pickle.py source code doesn't have decimal module.

so tried running code locally instead of on amazon vm , works flawlessly, imports same. realized have python 2.7.9 on local computer amazon running 2.7.11. causing issue? advice helpful. thank you.

# line of code loads pickle file. downloading # s3 bucket:   bucket = s3.bucket('kd-trees') mag_kd = mag_kd_tree_name  try:     bucket.download_file(mag_kd, 'mag_kdtree.pickle') except botocore.exceptions.clienterror e:     if e.response['error']['code'] == "404":         print("mag not exist.")     else:         raise #unpickle files: open('mag_kdtree.pickle') f:     mag_lat, mag_long, mag_nbrs = pickle.load(f)  return mag_lat, mag_long, mag_nbrs 

when run locally, file opens fine. if run on amazon's vm, gives import error.


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -