Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

some problems of using Python's Cryptography on Windows

I would like to use the cryptography’s module on Windows, I am using version 1.12 and Python 3.10.6, and I have some problems. Actually, when I run my script, I receive the error :

`

Traceback (most recent call last):
  File "C:/Users/edoua/Documents/cryptographie.py", line 1, in <module>
    from cryptography.fernet import Fernet
  File "C:\Users\edoua\AppData\Local\Programs\Python\Python310\lib\site-packages\cryptography\fernet.py", line 16, in <module>
    from cryptography.hazmat.primitives.hmac import HMAC
  File "C:\Users\edoua\AppData\Local\Programs\Python\Python310\lib\site-packages\cryptography\hazmat\primitives\hmac.py", line 10, in <module>
    from cryptography.hazmat.backends.openssl.hmac import _HMACContext
  File "C:\Users\edoua\AppData\Local\Programs\Python\Python310\lib\site-packages\cryptography\hazmat\backends\openssl\__init__.py", line 6, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "C:\Users\edoua\AppData\Local\Programs\Python\Python310\lib\site-packages\cryptography\hazmat\backends\openssl\backend.py", line 13, in <module>
    from cryptography import utils, x509
  File "C:\Users\edoua\AppData\Local\Programs\Python\Python310\lib\site-packages\cryptography\x509\__init__.py", line 7, in <module>
    from cryptography.x509.base import (
  File "C:\Users\edoua\AppData\Local\Programs\Python\Python310\lib\site-packages\cryptography\x509\base.py", line 28, in <module>
    from cryptography.x509.extensions import (
  File "C:\Users\edoua\AppData\Local\Programs\Python\Python310\lib\site-packages\cryptography\x509\extensions.py", line 25, in <module>
    from cryptography.x509.general_name import (
  File "C:\Users\edoua\AppData\Local\Programs\Python\Python310\lib\site-packages\cryptography\x509\general_name.py", line 9, in <module>
    from email.utils import parseaddr
  File "C:\Users/edoua/Documents\email.py", line 18, in <module>
    server.login(email_address, email_password)
  File "C:\Users\edoua\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 739, in login
    (code, resp) = self.auth(
  File "C:\Users\edoua\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 641, in auth
    response = encode_base64(initial_response.encode('ascii'), eol='')
NameError: name 'encode_base64' is not defined

`

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

It is coming from the smtplib.py file. Also, I precise that the module works perfectly, I can use all the functions of the module base64. So the problem is coming from the word ‘encode_base64’. Please help !

I tried to launch my program, and that error occures, I expected that it was going to work.

>Solution :

You have a local module C:\Users/edoua/Documents\email.py that is shadowing the email module from the Python standard library. Rename email.py to something else, or move it to somewhere that isn’t on the Python path.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading