Troubleshooting and Bugs#

Obtaining sunpy version#

To find out your sunpy version number, import it and print the __version__ attribute:

>>> import sunpy   
>>> sunpy.__version__   

System Info#

To quickly collect information on your system, you can use our convenience function system_info which you can run through:

>>> import sunpy   
>>> sunpy.util.system_info()   

The output should look something like:

==========================================================
 sunpy Installation Information

 Sunday, 18. November 2012 11:06PM UT
==========================================================

###########
 General
###########
OS: Mac OS X 10.8.2 (i386)
Python: 2.7.3 (64bit)

####################
 Required libraries
####################
sunpy: 0.1
NumPy: 1.6.2
SciPy: 0.10.1
Matplotlib: 1.2.x
PyFITS: 3.0.8
pandas: 0.8.1

#######################
 Recommended libraries
#######################
beautifulsoup4: 4.1.1
PyQt: 4.9.4
SUDS: 0.4'

This information is especially useful if you are running into a bug and need help.

Making use of the logger#

For information on configuring and using sunpy's logging system, a useful tool for troubleshooting, see Logger Objects.

sunpy install location#

You can find what directory sunpy is installed in by importing it and printing the __file__ attribute:

>>> import sunpy   
>>> sunpy.__file__   

.sunpy directory location#

Each user should have a .sunpy/ directory which should contain a sunpyrc file. To locate your .sunpy/ directory, use sunpy.print_config():

>>> import sunpy as sun   
>>> sun.print_config()   

We use appdirs to work out the location depending on your operating system.

If you would like to use a different configuration directory, you can do so by specifying the location in your SUNPY_CONFIGDIR environment variable.

Reporting Bugs#

If you are having a problem with sunpy, search the mailing list or the github issue tracker. It is possible that someone else has already run into your problem.

If not, please provide the following information in your e-mail to the mailing list or to the github issue tracker:

  • your operating system; (Linux/UNIX users: post the output of uname -a)

  • sunpy version:

    >>> import sunpy   
    >>> sunpy.util.system_info()   
    
  • how you obtained sunpy.

  • any customizations to your sunpyrc file (see Customizing sunpy).

  • Please try to provide a minimal, standalone Python script that demonstrates the problem. This is the critical step. If you can’t post a piece of code that we can run and reproduce your error, the chances of getting help are significantly diminished. Very often, the mere act of trying to minimize your code to the smallest bit that produces the error will help you find a bug in your code that is causing the problem.