neherlab / treetime_examples

A collection of documented examples using TreeTime
16 stars 15 forks source link

Errors related to parse_dates in running ebola.py script #5

Closed BioWu closed 4 years ago

BioWu commented 4 years ago

Hi, I got an error when reproducing the ebola.py script. Here are the error messages: Attempting to parse dates... Traceback (most recent call last): File "./ebola.py", line 30, in dates = parse_dates(base_name+'.metadata.csv') File "build/bdist.linux-x86_64/egg/treetime/utils.py", line 241, in parse_dates File "~/anaconda2/lib/python2.7/site-packages/pandas/io/parsers.py", line 646, in parser_f return _read(filepath_or_buffer, kwds) File "~/anaconda2/lib/python2.7/site-packages/pandas/io/parsers.py", line 389, in _read parser = TextFileReader(filepath_or_buffer, **kwds) File "~/anaconda2/lib/python2.7/site-packages/pandas/io/parsers.py", line 720, in init options = self._get_options_with_defaults(engine) File "~/anaconda2/lib/python2.7/site-packages/pandas/io/parsers.py", line 761, in _get_options_with_defaults ' %r engine' % (argname, engine)) ValueError: The 'dtype' option is not supported with the 'python' engine

After searching in Google, I think there might be some hide small bugs in pandas or in the parse_dates. I now try to update my pandas package. Also I wish to get some advice from you. Thanks!

rneher commented 4 years ago

could you try whether this issue also exists in python3? We'll be dropping python 2.7 support soon.

BioWu commented 4 years ago

I fixed up it by deleting the arg of ··engine='python' as in below:

` 241c241 new: df = pd.read_csv(date_file, sep=full_sep, engine='c', dtype='str', index_col=False)

old: df = pd.read_csv(date_file, sep=full_sep, engine='python', dtype='str', index_col=False) `

BioWu commented 4 years ago

Also, I try install the package [0.7.3] using bioconda in MacBook. Running the same dataset, the above error did not show up. I will run it in my macbook. :)