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

Ben Finney bignose at polar.local
Fri Dec 16 03:20:00 EST 2005


Xiao Jianfeng <fdu.xiaojf at gmail.com> writes:
> 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 ?

I would trust the error message first, and check your assumption.

Is 'chempy' actually a package, containing an 'Atom' module? Or is
'chempy' actually a module, containing an 'Atom' attribute?

-- 
 \        "I washed a sock. Then I put it in the dryer. When I took it |
  `\                              out, it was gone."  -- Steven Wright |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list