I have some python code I use for emails that recently stopped working. Trying to debug it, I discovered that imaplib.IMAP4_SSL exists in python started from an anaconda prompt, but not a regular windows command prompt. How is this possible?
Here's the simplest way I know to show:
- open anaconda prompt and windows command prompt
- in both prompts, type 'python' to start python
- both show the same python version (3.7.1 for me)
- type the following:
import imaplib
imaplib.IMAP4_SSL
The anaconda prompt returns a class and works fine, while the windows cmd prompt returns an error:
AttributeError: module 'imaplib' has no attribute 'IMAP4_SSL'
I thought maybe I had multiple versions of python installed, so I uninstalled everything related to python that I could find, then reinstalled anaconda. It didn't help.