[yt-users] Error importing yt.mods

Sam Geen samgeen at astro.ox.ac.uk
Fri May 9 08:48:19 PDT 2014


So the setup.py script isn't copying the folder owls_subfind when it 
installs to the site_packages folder. If you copy this folder by hand 
the bug disappears and the import works fine. Bug 2) is probably just a 
side-effect of trying to import after it encounters bug 1), I assume.

Sam

On 09/05/14 17:13, Sam Geen wrote:
> Hi,
>
> I've downloaded the latest version of the yt-3.0 branch, and have run 
> into some import errors. I've numbered them 1) and 2) below. 1) is 
> "ImportError: No module named owls_subfind.api" and 2) is a problem 
> locating yt.utilities.
>
> I've deleted the yt egg file and downloaded a clean cloned version, 
> and the errors persist. Any ideas?
>
> Thanks!
>
> Sam
>
> ---
>
> 1)
> ------
>
> In [1]: import yt.mods
> yt : [DEBUG    ] 2014-05-09 16:07:19,697 Set log level to 0
> yt : [DEBUG    ] 2014-05-09 16:07:22,067 Registering: Dataset as 
> <class 'yt.data_objects.static_output.Dataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,145 Registering: ARTDataset as 
> <class 'yt.frontends.art.data_structures.ARTDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,149 Registering: ARTIODataset as 
> <class 'yt.frontends.artio.data_structures.ARTIODataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,152 Registering: AthenaDataset as 
> <class 'yt.frontends.athena.data_structures.AthenaDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,161 Registering: BoxlibDataset as 
> <class 'yt.frontends.boxlib.data_structures.BoxlibDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,161 Registering: OrionDataset as 
> <class 'yt.frontends.boxlib.data_structures.OrionDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,161 Registering: CastroDataset as 
> <class 'yt.frontends.boxlib.data_structures.CastroDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,161 Registering: MaestroDataset 
> as <class 'yt.frontends.boxlib.data_structures.MaestroDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,161 Registering: NyxDataset as 
> <class 'yt.frontends.boxlib.data_structures.NyxDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,165 Registering: ChomboDataset as 
> <class 'yt.frontends.chombo.data_structures.ChomboDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,165 Registering: Orion2Dataset as 
> <class 'yt.frontends.chombo.data_structures.Orion2Dataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,174 Registering: EnzoDataset as 
> <class 'yt.frontends.enzo.data_structures.EnzoDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,174 Registering: 
> EnzoDatasetInMemory as <class 
> 'yt.frontends.enzo.data_structures.EnzoDatasetInMemory'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,174 Registering simulation: Enzo 
> as <class 'yt.frontends.enzo.simulation_handling.EnzoSimulation'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,178 Registering: FITSDataset as 
> <class 'yt.frontends.fits.data_structures.FITSDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,314 Registering: FLASHDataset as 
> <class 'yt.frontends.flash.data_structures.FLASHDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,317 Registering: GDFDataset as 
> <class 'yt.frontends.gdf.data_structures.GDFDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,321 Registering: 
> HaloCatalogDataset as <class 
> 'yt.frontends.halo_catalogs.halo_catalog.data_structures.HaloCatalogDataset'>
> yt : [DEBUG    ] 2014-05-09 16:07:22,324 Registering: RockstarDataset 
> as <class 
> 'yt.frontends.halo_catalogs.rockstar.data_structures.RockstarDataset'>
> --------------------------------------------------------------------------- 
>
> ImportError                               Traceback (most recent call 
> last)
> <ipython-input-1-fcd62da66eec> in <module>()
> ----> 1 import yt.mods
>
> /home/samgeen/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/__init__.pyc 
> in <module>()
>     124
>     125 from yt.frontends.api import _frontend_container
> --> 126 frontends = _frontend_container()
>     127
>     128 from yt.frontends.stream.api import \
>
> /home/samgeen/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/frontends/api.pyc 
> in __init__(self)
>      39         for frontend in _frontends:
>      40             _mod = "yt.frontends.%s.api" % frontend
> ---> 41             setattr(self, frontend, 
> importlib.import_module(_mod))
>
> /home/samgeen/lib/python2.7/importlib/__init__.pyc in 
> import_module(name, package)
>      35             level += 1
>      36         name = _resolve_name(name[level:], package, level)
> ---> 37     __import__(name)
>      38     return sys.modules[name]
>
> /home/samgeen/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/frontends/halo_catalogs/api.py 
> in <module>()
>      25       RockstarFieldInfo
>      26
> ---> 27 from .owls_subfind.api import \
>      28      OWLSSubfindDataset, \
>      29      IOHandlerOWLSSubfindHDF5, \
>
> ImportError: No module named owls_subfind.api
>
>
> 2)
> ---
>
> In [3]: import yt
> --------------------------------------------------------------------------- 
>
> AttributeError                            Traceback (most recent call 
> last)
> <ipython-input-3-59dfcfe9846c> in <module>()
> ----> 1 import yt
>
> /home/samgeen/.local/lib/python2.7/site-packages/yt-3.0dev-py2.7-linux-x86_64.egg/yt/__init__.py 
> in <module>()
>      97 from yt.utilities.logger import ytLogger as mylog
>      98
> ---> 99 import yt.utilities.physical_constants as physical_constants
>     100 import yt.units as units
>     101 from yt.units.yt_array import YTArray, YTQuantity
>
> AttributeError: 'module' object has no attribute 'utilities'
>
> ----
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org




More information about the yt-users mailing list