Search code examples
pythonastropy

Astroquery: AttributeError("'bytes' object has no attribute 'encode'")


I would like to run the NED query of the astroquery package.

from astroquery.ned import Ned
result_table = Ned.query_object("NGC 224")

this is given by the example in the Documentary.

I got the following issue:

TableParseError: Failed to parse NED result! The raw response can be found in
self.response, and the error in self.table_parse_error.

In self.table_parse_error I find:

 AttributeError("'bytes' object has no attribute 'encode'")

I have no idea what has gone wrong.

Here are my versions:

Python  3.4.1 (default, May 19 2014, 17:23:49) [GCC 4.9.0 20140507 (prerelease)]
SciPy   0.14.0
Cython  0.20.1
OS      posix [linux]
Numpy   1.8.1
IPython 2.1.0

Solution

  • This was raised as an issue on astroquery and is a confirmed bug: https://github.com/astropy/astroquery/pull/343

    it should be fixed shortly