Error: Cannot import pyfits or astropy

312 views
Skip to first unread message

harryk

unread,
Oct 29, 2016, 5:34:04 PM10/29/16
to astrometry
Installed astrometry on mac via homebrew without errors. However I cannot get it to solve successfully. The following is the command I'm running and error I'm getting. I've updated both pyfits and astropy. 

Harrys-Mac-Pro:~ Harry$ solve-field --scale-low 10 /Users/Harry/Desktop/apod4.jpg

Reading input file 1 of 1: "/Users/Harry/Desktop/apod4.jpg"...

jpegtopnm: WRITING PPM FILE

Read file stdin: 719 x 507 pixels x 1 color(s); maxval 255

Using 8-bit output

Extracting sources...


simplexy: found 1467 sources.

Traceback (most recent call last):

  File "/usr/local/bin/removelines.py", line 20, in <module>

    raise ImportError("Cannot import either pyfits or astropy.io.fits")

ImportError: Cannot import either pyfits or astropy.io.fits

augment-xylist.c:588:backtick Failed to run command: /usr/local/bin/removelines.py -e 1 /tmp/tmp.xyls.4jZITc /tmp/tmp.removelines.TyJdUT

 ioutils.c:567:run_command_get_outputs Command failed: return value 1


Dustin Lang

unread,
Oct 30, 2016, 8:55:56 AM10/30/16
to astrometry
Hi,

What do you get with

python -c "import pyfits; print pyfits.__file__"

and

python -c "import astropy; print astropy.__file__"

?  If those run and print the path, then something is going wrong with the astrometry code; if not, your python install can't find the astropy/pyfits code.


You can avoid running "removelines" by adding

solve-field --no-remove-lines

you might also want to avoid the other python preprocessing steps,

solve-field --no-remove-lines --uniformize 0 --no-fits2fits

cheers,
--dustin

harryk

unread,
Oct 30, 2016, 4:22:55 PM10/30/16
to astrometry
Running those did not yield a path. Not sure what the problem was but I reinstalled pyfits and astropy from source and now everything seems to work.
Thanks for the help
Reply all
Reply to author
Forward
0 new messages