Python Forum
IMAPLib Has No Attribute IMAP4_SSL. Help!
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IMAPLib Has No Attribute IMAP4_SSL. Help!
#1
I've written a Python script that checks an email address on an Exchange server once per minute to check for new emails, download those emails as individual text files, then turn around and parse thru each of those individual text files to scrape desired info. from the emails and insert the data into Oracle.

The script has worked perfectly fine on my development box for months as it's undergone development. I'm hitting a major road block now that I've tried to compile the script to an EXE (using PyInstaller) and execute it in various environments (INT / QA / PROD) in testing out the functionality.

Below is a very scaled down snippet of the basic lines that take care of establishing a connection to the email server and logging the desired email inbox:

import imaplib

def open_connection(verbose=False):

	try:
		# Connect to the server
		connection = imaplib.IMAP4_SSL('someserver.somedomain.com',993)

		# Login to our account
		connection.login("username", "password")
		return connection 
	except Exception as e:
		print ("Email login connection error: " + str(e))
		return 'Failed'

print (open_connection())
The error message I'm getting back from trying to run the compiled EXE on any other machine beyond the development machine is:
  • IMAPLib has no attribute IMAP4_SSL

I've racked my brain extensively on this, have researched possible fixes & solutions, have tried switching out the IMAPLib to POP3 instead, with all of these various ways of establishing a connection being successful until I use PyInstaller to compile the native .py script to a self-executing EXE, and then these EXEs don't work on other computers. For example, when I change the server/email access protocol from IMAPLib to POP3, then I receive a similar error message as the one with IMAPLib:
  • POPLib has no attribute POP3

I'd sincerely appreciate any recommendations at all on this. Thanks in advance.
Reply


Messages In This Thread
IMAPLib Has No Attribute IMAP4_SSL. Help! - by bmccollum - Jun-12-2020, 03:20 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Assistance debuging imaplib errors Linh_lee 1 1,069 Aug-21-2022, 05:57 PM
Last Post: Linh_lee
  imaplib problem levann 3 3,772 Jul-15-2019, 10:05 AM
Last Post: levann
  How can read and download the attachment from the mail using while loop in IMAPlib Py Samjith 0 4,319 Oct-11-2018, 07:15 AM
Last Post: Samjith
  Email Checker with IMAPlib ronaldrios 1 3,830 Jun-23-2017, 04:03 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020