andycasey/gaia-on-tap

Using Gaia-on-tap on Windows

Closed this issue · 3 comments

Using the code for the first two examples given has resulted in this error message:

runfile('C:/Users/Joseph/untitled1.py', wdir='C:/Users/Joseph')
Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/Joseph/untitled1.py', wdir='C:/Users/Joseph')

File "C:\Users\Joseph\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
execfile(filename, namespace)

File "C:\Users\Joseph\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Joseph/untitled1.py", line 11, in
cluster_candidates = cone_search(cluster.ra.deg, cluster.dec.deg, 1.0)

File "C:\Users\Joseph\Anaconda3\lib\site-packages\gaia\tap\query.py", line 102, in cone_search
table=table, ra=ra, dec=dec, radius=radius), **kwargs)

File "C:\Users\Joseph\Anaconda3\lib\site-packages\gaia\tap\query.py", line 62, in query
data = Table.read(StringIO(response.text), format="votable")

File "C:\Users\Joseph\Anaconda3\lib\site-packages\astropy\table\table.py", line 2332, in read
return io_registry.read(cls, *args, **kwargs)

File "C:\Users\Joseph\Anaconda3\lib\site-packages\astropy\io\registry.py", line 351, in read
data = reader(*args, **kwargs)

File "C:\Users\Joseph\Anaconda3\lib\site-packages\astropy\io\votable\connect.py", line 73, in read_table_votable
input = parse(input, table_id=table_id)

File "C:\Users\Joseph\Anaconda3\lib\site-packages\astropy\io\votable\table.py", line 140, in parse
config=config, pos=(1, 1)).parse(iterator, config)

File "C:\Users\Joseph\Anaconda3\lib\site-packages\astropy\io\votable\tree.py", line 3343, in parse
for start, tag, data, pos in iterator:

TypeError: expected bytes, str found

The examples are being run in Python 3.5.2 |Anaconda 4.2.0 (64-bit)| using Spyder (downloaded as part of the Anaconda package) with Windows 7 Home Premium. The version of Astropy is 1.2.1 (also downloaded as part of the Anaconda package).

The code used is cut-and-pasted from the given examples:

import astropy.coordinates as coord
from gaia.tap import cone_search

cluster = coord.SkyCoord.from_name("M67")
cluster_candidates = cone_search(cluster.ra.deg, cluster.dec.deg, 1.0)

The same code run on a Mac does not return the same error message.

I get the exact same error when trying to run the example query (cone_search) or any query of my own using gaia.tap.query(...). I am running on Fedora 25, python 3.5.2, astropy 1.2.1.
@Jarmstrong93, which Python version do you have in the Mac machine?

The Mac was not my machine but belonged to another researcher I met when introduced to Gaia-on-tap, I'm afraid I can't remember which version he had. On my Windows machine I have python 3.5.2 and astropy 1.2.1 also.

Turns out this was a python 3 issue. Sorry for letting it slip through the cracks. Now fixed in bd32bf6 (v0.1.8).