boto3 client NoRegionError: You must specify a region error only sometimes
<p>I have a boto3 client :</p>

<pre><code>boto3.client('kms')
</code></pre>

<p>But it happens on new machines, They open and close dynamically. </p>

<pre><code>    if endpoint is None:
        if region_name is None:
            # Raise a more specific error message that will give
            # better guidance to the user what needs to happen.
            raise NoRegionError()
</code></pre>

<p>Why is this happening? and why only part of the time?</p>