The difference between "import package.module" and "from packageimport module"(about pymol)

Fredrik Lundh fredrik at
Fri Dec 16 09:06:31 CET 2005

Xiao Jianfeng wrote:

> In pymol I can use "from chempy import Atom" but "import
> chempy.Atom" doesn't work. It says,"ImportError: No module
> named Atom". What is going wrong ?

are you sure Atom is a module ?


>>> from os import remove
>>> remove
<built-in function remove>

>>> import os.remove
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named remove


More information about the Python-list mailing list