Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I have an error on an application that ran before well:

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

The version of cryptography library is 2.2.2 and I made sue that the file certificate_transparency.py exists in the required folder. What could be the root of the above problem?

pip 10.0.1 from /home/serj/.local/lib/python2.7/site-packages/pip (python 2.7)

I found a simple solution. But it requires changes to the source code.

  • Add path of the certificate_transparency file:
  • import sys, os
    sys.path.append(os.path.append('/usr/lib/python2.7/site-packages/cryptography/x509'))
    
  • Change the code in /usr/lib/python2.7/site-packages/cryptography/x509/__init__.py
  • Then replace this (old line): from cryptography.x509 import certificate_transparency

    with this (new line): import certificate_transparency

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.