No module named util

1,587 views
Skip to first unread message

Dylan Gatlin

unread,
Apr 14, 2019, 2:17:17 PM4/14/19
to astrometry
I installed astrometry locally using apt, and I've gotten it to work before a few months ago. I tried it with some new files to see what would happen, and it's giving me a new error,

```/usr/bin/python: No module named util
augment-xylist.c:589:backtick Failed to run command: /usr/bin/python -m astrometry.util.image2pnm --infile <filename.fits> --uncompressed-output /tmp/tmp.uncompressed.80PLVU --outfile /tmp/tmp.ppm.PUqf0K --ppm --mydir /usr/bin/solve-field
 ioutils.c:567:run_command_get_outputs Command failed: return value 1```

Any idea where this comes from? The images are normal and can open in DS9. /usr/bin/python is version 2.7.15rc1, which seems strange since I thought astrometry.net runs on python3?

Dustin Lang

unread,
Apr 14, 2019, 2:34:00 PM4/14/19
to Dylan Gatlin, astrometry
Astrometry.net is compatible with both python2 and python3, but it doesn't get to choose how it gets run :)  For this problem, you should probably ask the debian folks who packaged it; we don't run the scripts that way in the vanilla code.  You could also check your PYTHONPATH environment variable -- it looks like maybe it's finding an astrometry directory/package, but it doesn't have a "util" subdirectory?  Can run
    python -c "import astrometry; print(astrometry.__file__)"
to find out where it's finding astrometry.

cheers,
--dustin

--
You received this message because you are subscribed to the Google Groups "astrometry" group.
Visit this group at https://groups.google.com/group/astrometry.

Ole Streicher

unread,
Apr 14, 2019, 2:58:19 PM4/14/19
to astro...@googlegroups.com
Dustin Lang <dstn...@gmail.com> writes:
> Astrometry.net is compatible with both python2 and python3, but it
> doesn't get to choose how it gets run :) For this problem, you should
> probably ask the debian folks who packaged it; we don't run the
> scripts that way in the vanilla code.

The version we support depends on the distribution: In December 2018, we
switched fom Python 2 to Python 3 for the astrometry.net Python
module. So, in Debian Stretch it is Python 2, Buster (currently Testing)
will get the Python 3 module. For Ubuntu, probably 19.04 will be the
first with the Python 3 module; therefore I guess this iy Python 2.

I must however say that I don't really understand the problem
here. Dylan, could you provide some system information (distribution,
astrometry.net version etc.)?

> You could also check your PYTHONPATH environment variable -- it looks
> like maybe it's finding an astrometry directory/package, but it
> doesn't have a "util" subdirectory? Can run python -c "import
> astrometry; print(astrometry.__file__)" to find out where it's finding
> astrometry.

That sounds sensible. What also could help is

$ ls -l /usr/lib/python2.7/dist-packages/astrometry/util/

to check whether the files are correctly installed.

On Sun, Apr 14, 2019 at 2:17 PM Dylan Gatlin <dgat...@gmail.com> wrote:
> Any idea where this comes from? The images are normal and can open in
> DS9. /usr/bin/python is version 2.7.15rc1, which seems strange since
> I thought astrometry.net runs on python3?

That looks like Ubuntu 18.04, right? At least, there are no bug reports
for astrometry.net yet.

Best regards

Ole

Dylan Gatlin

unread,
Apr 14, 2019, 8:11:41 PM4/14/19
to astrometry
HAHAHAHAHHA!

I created a file astrometry.py, which I was using as a wrapper to loop through my images, little did I realize that this would interfere with some of astrometry's imports. I renamed my file to plate_solve.py, and voila, everything works! Thank you for the help, this would have taken me much longer on my own.

-Dylan

Dustin Lang

unread,
Apr 14, 2019, 8:42:59 PM4/14/19
to Dylan Gatlin, astrometry
:)  I *may* have done that once or twice in my life :)
Glad to hear you're up and running.


--
Reply all
Reply to author
Forward
0 new messages