Python Forum
cryptographic error - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: cryptographic error (/thread-11117.html)



cryptographic error - saisankalpj - Jun-23-2018

Hi all

when i am using the import statement "from OpenSSL import crypto",i am getting an error like "cannot import certificate transperency".how should i resolve this issue.


RE: cryptographic error - Larz60+ - Jun-23-2018

if on windows, run:
python -m pip install --upgrade pip
else on Linux, run:
pip install --upgrade pip
and reinstall package


RE: cryptographic error - saisankalpj - Jun-23-2018

(Jun-23-2018, 11:04 AM)Larz60+ Wrote: if on windows, run:
 python -m pip install --upgrade pip 
else on Linux, run:
 pip install --upgrade pip 
and reinstall package
i have tried this doesnt seem to solve the problem
and what do you mean by reinstall package
thank you

(Jun-23-2018, 05:46 PM)saisankalpj Wrote:
(Jun-23-2018, 11:04 AM)Larz60+ Wrote: if on windows, run:
 python -m pip install --upgrade pip 
else on Linux, run:
 pip install --upgrade pip 
and reinstall package
i have tried this doesnt seem to solve the problem and what do you mean by reinstall package thank you
i am already using pip 10.00

this the error i am getting
tge application ran well before

File "/usr/lib/python2.7/site-packages/cryptography/x509/__init__.py", line 7, in <module>
from cryptography.x509 import certificate_transparency
ImportError: cannot import name certificate_transparency


RE: cryptographic error - Larz60+ - Jun-23-2018

there are some dependencies, see: https://cryptography.io/en/latest/development/getting-started/?highlight=example
and then see: https://cryptography.io/en/latest/x509/certificate-transparency/?highlight=certificate_transparency


RE: cryptographic error - ljmetzger - Jun-24-2018

@Lars60+ excellent links. Please note that OP is using Linux and Python 2.7.

There have been numerous cases where ImportError: cannot import name certificate_transparency have been reported, and may have been a bug at one time. An additional fix included updating pip, Python, and all packages to the latest versions, before installing cryptography.

I was able to run the following code (after installing cryptography from PYPI pip install cryptography successfully on Windows 10 using Python 2.7.13 and Python 3.6.5:
from cryptography.x509 import certificate_transparency

print("done")
Lewis


RE: cryptographic error - saisankalpj - Jun-24-2018

(Jun-24-2018, 10:02 AM)ljmetzger Wrote: @Lars60+ excellent links. Please note that OP is using Linux and Python 2.7. There have been numerous cases where ImportError: cannot import name certificate_transparency have been reported, and may have been a bug at one time. An additional fix included updating pip, Python, and all packages to the latest versions, before installing cryptography. I was able to run the following code (after installing cryptography from PYPI pip install cryptography successfully on Windows 10 using Python 2.7.13 and Python 3.6.5:
from cryptography.x509 import certificate_transparency print("done")
Lewis
iam getting the cryptographic error when i write the statement"from OpenSSL import crypto".the application was working fine before.could you help me
thank you


RE: cryptographic error - ljmetzger - Jun-25-2018

Since the application was working before, you seem to have some kind of configuration problem. Please note that the PYPI version of pyopenssl was updated to 18.0 on May 16, 2008. Again using Python 2.7 and Windows 10 I successfully ran the following code:
from OpenSSL import crypto
from cryptography.x509 import certificate_transparency

print("done")
This might not help much since you are on a Linux system.

You might want to consider giving your copy of Python 2.7 the Death Penalty, and reinstall Python 2.7 and all packages you need.

Lewis


RE: cryptographic error - saisankalpj - Jun-25-2018

(Jun-25-2018, 12:55 PM)ljmetzger Wrote: Since the application was working before, you seem to have some kind of configuration problem. Please note that the PYPI version of pyopenssl was updated to 18.0 on May 16, 2008. Again using Python 2.7 and Windows 10 I successfully ran the following code:
from OpenSSL import crypto from cryptography.x509 import certificate_transparency print("done")
This might not help much since you are on a Linux system. You might want to consider giving your copy of Python 2.7 the Death Penalty, and reinstall Python 2.7 and all packages you need. Lewis
thanks i have resolved the issue by just installing "cffi" in the command prompt