'EntryPoint' object has no attribute 'resolve' when using Google Compute Engine
<p>I have an issue related to Cryptography package in Python. Can you please help in resolving these, if possible ? (tried a lot, but couldnt figure out the exact solution)</p>

<p>The python code which initiates this error: </p>

<pre><code>print("Salt: %s" % salt)
server_key = pyelliptic.ECC(curve="prime256v1")  # -----&gt;&gt; Line2
print("Server_key: %s" % server_key)   # -----&gt;&gt; Line3
server_key_id = base64.urlsafe_b64encode(server_key.get_pubkey()[1:])

http_ece.keys[server_key_id] = server_key
http_ece.labels[server_key_id] = "P-256"
encrypted = http_ece.encrypt(data, salt=salt, keyid=server_key_id,
            dh=self.receiver_key, authSecret=self.auth_key)  # -----&gt;&gt; Line8
</code></pre>

<p>Value of "Salt" is getting displayed in 100% of the cases. </p>

<p>If <strong>Line3</strong> gets executed successfully, I see the the following EntryPoint Error because of http_ece.encrypt() call (<strong>Line8</strong>):</p>

<pre><code>AttributeError("'EntryPoint' object has no attribute 'resolve'",)
</code></pre>

<p>(Ref. File Link: <a href="https://github.com/martinthomson/encrypted-content-encoding/blob/master/python/http_ece/__init__.py#L128">https://github.com/martinthomson/encrypted-content-encoding/blob/master/python/http_ece/init.py#L128</a> )</p>

<p>Requirements.txt(partial):</p>

<pre><code>cryptography==1.5
pyelliptic==1.5.7
pyOpenSSL==16.1.0
</code></pre>

<p>On Running the command: <code>sudo pip freeze --all |grep setuptools</code>, I get:
<code>setuptools==27.1.2</code></p>

<p>Please let me know if any more detail is required.</p>

<p>This problem seems to be basically due to some Old/Incompatible packages(related to PyElliptic, Cryptography, PyOpenSSL and/or setuptools) installed on the VM. For Reference: <a href="https://github.com/pyca/cryptography/issues/3149">https://github.com/pyca/cryptography/issues/3149</a></p>

<p>Can someone please suggest a good solution to resolve this issue completely ?</p>

<p>Thanks,</p>

<p>The <a href="https://github.com/pyca/cryptography/issues/2838" rel="nofollow">issue</a> referenced in <a href="http://stackoverflow.com/questions/39413987/entrypoint-object-has-no-attribute-resolve-when-using-google-compute-engine?noredirect=1#comment66303382_39413987">c66303382</a> has this traceback (you never gave your traceback so I have to assume yours ends the same way):</p>

<pre><code>File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/__init__.py", line 35, in default_backend
    _default_backend = MultiBackend(_available_backends())
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/__init__.py", line 22, in _available_backends
    "cryptography.backends"
</code></pre>

<p><a href="https://github.com/pyca/cryptography/blob/1a6628e55126ec1c98c98a46c04f777f77eff934/src/cryptography/hazmat/backends/__init__.py#L19-L24" rel="nofollow">The full line</a> that triggers the error looks like this:</p>

<pre><code>_available_backends_list = [
        ep.resolve()
        for ep in pkg_resources.iter_entry_points(
            "cryptography.backends"
        )
    ]
</code></pre>

<p>Searching the <a href="https://github.com/pypa/setuptools" rel="nofollow">repository</a> for <code>EntryPoint</code> definition, then <a href="https://github.com/pypa/setuptools/blame/master/pkg_resources/__init__.py#L2260" rel="nofollow">blaming <code>pkg_resources/__init__.py</code></a> where it is reveals that <code>pkg_resources.EntryPoint.resolve()</code> was added in <a href="https://github.com/pypa/setuptools/commit/92a553d3adeb431cdf92b136ac9ccc3f2ef98bf1" rel="nofollow">commit 92a553d3adeb431cdf92b136ac9ccc3f2ef98bf1</a> (2015-01-05) that went into <code>setuptools v11.3</code>.</p>

<p>Thus you'll see this error if you use an older version.</p>

python django cryptography google-compute-engine