我可以在 Windows 上使用 python 2.7 解释器毫无问题地上传数据。但是在我将其编译为 exe 后,它在行显示错误:
s3 = session.client('s3')
import HTMLParser
import ConfigParser
# Above packages necessary because boto3 depend on them
import boto3
from boto3.session import Session
# variable initialization
session = boto3.session.Session()
s3 = session.client('s3') #Error at this line
s3.upload_file(fileToUpload, bucketName, keyName)
错误是:
Traceback (most recent call last):
File "myProg.py", line 39, in <module>
File "boto3\session.pyc", line 199, in client
File "botocore\session.pyc", line 754, in create_client
File "botocore\session.pyc", line 660, in get_component
File "botocore\session.pyc", line 774, in get_component
File "botocore\session.pyc", line 174, in <lambda>
File "botocore\session.pyc", line 453, in get_data
File "botocore\loaders.pyc", line 119, in _wrapper
File "botocore\loaders.pyc", line 364, in load_data
botocore.exceptions.DataNotFoundError: Unable to load data for: _endpoints
可能是什么问题?