Forums

Module not showing up in Notebook

I'm sure there's a simple explanation for this. I'm trying to use the email module in a notebook using 3.4. I installed it in bash using [easy_install-3.4 --user email], since pip install was failing. But the 3.4 notebook doesn't show it when I run the following

import pip
installed_packages = pip.get_installed_distributions()
installed_packages_list = sorted(["%s==%s" % (i.key, i.version)
for i in installed_packages])
installed_packages_list

and I get a consequent error when trying to import: No module named 'email.MIMEMultipart'

In the bash console I see the email module listed when I type "pip3.4 list"

Perhaps I am not initiating the 3.4 notebook properly? thanks!

Hi there, that's quite weird. Do you mean that standard library module here?

If so, you should not need to pip install it. Could it be that you are confusing python2 vs python3 email modules though? eg; maybe in python3 it's something like from email.mime.multipart import MIMEMultipart

I was indeed using Python2 syntax. Works if use the proper import syntax as you note. The package appears to load fine now. Not sure why it doesn't show up in the notebook module list - might be because it already comes packaged as part of the standard core distribution. Thanks for the help.

I think that must be it -- pip probably doesn't tell you about standard core libraries.