Skip to content

Installation FAQ (pip, setup.py)

Mike Jarvis edited this page Apr 21, 2018 · 38 revisions

This page covers questions about installing GalSim with pip or setup.py. For questions about installing with SCons, go here.

Sorry this page is so spare currently. This is a new installation process, so we're not sure yet what the "frequently-asked" questions will be. For now, see the installation instructions here

  1. Dependencies

  2. Installing with pip

  3. Installing with setup.py

  4. Installing with conda

  5. Importing galsim after installation



1. Dependencies


2. Installing with pip


3. Installing with setup.py


4. Installing with conda


5. Importing galsim after installation

ImportError: cannot import name '_galsim'

a) This error can happen if you try to import galsim in the GalSim repository directory. Python tries to import the galsim directory that it finds there, rather than the (correct) installed one. Try changing to a different directory and running Python from there.

b) Sometimes you can end up with multiple GalSim versions installed on your machine, and python can get confused about which one is the right one to use. Especially if you have switched among the pip, SCons, and setup.py installation methods. Try deleting any old versions of GalSim on your system and trying again.

Note: If you aren't sure which GalSim installation python is trying to import, you can use the imp module. imp.find_module('galsim') returns a tuple whose second element is the directory location of galsim that import galsim will try to import.

Clone this wiki locally