ContextLab / quail

A python toolbox for analyzing and plotting free recall data
http://cdl-quail.readthedocs.io/en/latest/
MIT License
20 stars 10 forks source link

`izip_longest` not found #111

Closed jeremymanning closed 5 years ago

jeremymanning commented 5 years ago

importing quail in python 3 results in the following error:

/opt/conda/lib/python3.6/site-packages/quail/__init__.py in <module>()
----> 1 from .load import load, load_example_data
      2 from .egg import Egg
      3 from .analysis import analyze
      4 from .plot import plot
      5 from .helpers import stack_eggs, crack_egg, recmat2egg, load_egg

/opt/conda/lib/python3.6/site-packages/quail/load.py in <module>()
      5 import re
      6 import csv
----> 7 from itertools import izip_longest
      8 from collections import Counter
      9 import pandas as pd

ImportError: cannot import name 'izip_longest'

It looks like izip_longest was renamed to zip_longest in the Python 3 version of itertools (see this post)

I think something the following change to load.py would fix the issue:

import sys
if sys.version_info[0] < 3:
    from itertools import izip_longest
else:
    from itertools import zip_longest as izip_longest
jeremymanning commented 5 years ago

nvm...seems to be an issue with the version of quail installed in the Sherlock container...

jeremymanning commented 5 years ago

hey team-- i'm getting this issue again. did we resolve it? if so, how?

jeremymanning commented 5 years ago
>>> import quail
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/quail/__init__.py", line 1, in <module>
    from .load import load, load_example_data
  File "/usr/local/lib/python3.6/site-packages/quail/load.py", line 7, in <module>
    from itertools import izip_longest
ImportError: cannot import name 'izip_longest'
paxtonfitzpatrick commented 5 years ago

@jeremymanning it looks like your import statement is referencing an old version of quail still on your computer. from itertools import izip_longest was removed here. I wasn't able to replicate the issue with either the current pip or github version.

paxtonfitzpatrick commented 5 years ago

hey @jeremymanning, are we ready to close this issue?

jeremymanning commented 5 years ago

i think so...closing.