# Missing modules running CatSim

**URL:** <https://www.rubin.community/t/missing-modules-running-catsim/2628>\
**Category:** Support\
**Created:** [January 29, 2018, 1:37am UTC](https://www.rubin.community/t/missing-modules-running-catsim/2628 "2018-01-29T01:37:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lundmb](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/lundmb/32/601_2.png) [@lundmb](https://www.rubin.community/u/lundmb)\
**Post date:** [January 29, 2018, 1:37am UTC](https://www.rubin.community/t/missing-modules-running-catsim/2628/1 "2018-01-29T01:37:09Z")

</div>

I’m trying to use CatSim, but I’m having an across the board failure to find any of the modules in the sample scripts.

I’m using the code samples as a guide that are located here: [https://confluence.lsstcorp.org/display/SIM/Framework+Overview+--+Catalog+Simulations](https://confluence.lsstcorp.org/display/SIM/Framework+Overview+--+Catalog+Simulations)

However, in trying to run any of that code, I’m receiving errors on trying to import all the LSST modules. Since I’m not sure where the issue is, I’m outlining fully how I’m trying to run this.

I’ve started with this, as per the instructions on the setup and installation page  
source loadLSST.bash  
setup sims\_catUtils -t sims

However, I’ve then tried to import each of the modules used on that page, and these are the results I’m getting:  
File “[WDcat.py](http://WDcat.py)”, line 1, in   
from lsst.sims.catalogs.generation.db import CatalogDBObject  
ModuleNotFoundError: No module named ‘lsst.sims.catalogs.generation’

```
  File "WDcat.py", line 1, in <module>
    from lsst.sims.photUtils.Photometry import PhotometryStars
ModuleNotFoundError: No module named 'lsst.sims.photUtils.Photometry'

Traceback (most recent call last):
  File "WDcat.py", line 1, in <module>
    from lsst.sims.catalogs.catUtils.baseCatalogModels import *
ModuleNotFoundError: No module named 'lsst.sims.catalogs.catUtils'

Traceback (most recent call last):
  File "WDcat.py", line 1, in <module>
    from lsst.sims.catalogs.measures.instance import InstanceCatalog
ModuleNotFoundError: No module named 'lsst.sims.catalogs.measures'

```

I’ve previously worked with MAF with no similar problems, although I’ve tried to dig around to locate where these modules are, and I’ve been unsuccessful. So, for example, to find ‘lsst.sims.catalogs.generation’, lsst.sims.catalogs.generation, I’ve tried running locate catalogs | grep measures and I don’t return anything, so I at least don’t have a file that has both catalogs and measures in the path, which is what I would expect given the explanation of the code here: [https://confluence.lsstcorp.org/display/SIM/Code+Overview+--+Catalog+Simulations](https://confluence.lsstcorp.org/display/SIM/Code+Overview+--+Catalog+Simulations)

This makes me think that just doing the normal install doesn’t install all the modules needed to run CatSim, but there’s no mention of this on the install page that CatSim needs additional files installed from elsewhere.

---

<div class="post-metadata">

**Author:** ![danielsf](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/danielsf/32/440_2.png) [@danielsf](https://www.rubin.community/u/danielsf)\
**Post date:** [January 29, 2018, 5:02pm UTC](https://www.rubin.community/t/missing-modules-running-catsim/2628/2 "2018-01-29T17:02:34Z")

</div>

It sounds like your script was written to be run against a very old version of CatSim. For instance: all of the `lsst.sims.catalogs.generation` code was moved into `lsst.sims.catalogs.db` about a year and a half ago; `lsst.sims.catalogs.measures` was split up among `lsst.sims.catalogs.defintions` and `lsst.sims.catalogs.decorators` at about the same time; `PhotometryStars` now lives in `lsst.sims.catUtils.mixins`.

If you want to email me your script, I can probably update the import statements in about fifteen minutes. My email address is scottvalscott at [gmail.com](http://gmail.com). Or if there’s a github repository you can point me to, I can issue a pull request.

Sorry about this. Our initial organization of the CatSim packages didn’t really reflect how the packages were used, so we decided to fix it.

---

<div class="post-metadata">

**Author:** ![lundmb](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/lundmb/32/601_2.png) [@lundmb](https://www.rubin.community/u/lundmb)\
**Post date:** [January 30, 2018, 12:58am UTC](https://www.rubin.community/t/missing-modules-running-catsim/2628/3 "2018-01-30T00:58:40Z")

</div>

Thus far, I was just trying to run the code available from the CatSim documentation as I’m trying to figure out how to run CatSim: [https://confluence.lsstcorp.org/display/SIM/Framework+Overview+--+Catalog+Simulations](https://confluence.lsstcorp.org/display/SIM/Framework+Overview+--+Catalog+Simulations)

So all the code is from that page, however even after those adjustments, I’m hitting enough issues that it makes me think other aspects of the CatSim structure don’t match the online documentation for similar reasons.

I think the goal I have may be relatively straight forward, as I’m attempting to create a full catalog of white dwarfs in the LSST footprint, with the RA, Dec, ugrizy apparent magnitudes, and ideally mass, radius, and distance. In digging deeper it also looks like since CatSim needs extra steps to access the simulation database, so I’ll be emailing you regarding that as well.
