alecthomas / importmagic

A Python library for finding unresolved symbols in Python code, and the corresponding imports
BSD 2-Clause "Simplified" License
120 stars 20 forks source link

AttributeError: 'SymbolIndex' object has no attribute 'get_or_create_index' #52

Open brandon-rhodes opened 5 years ago

brandon-rhodes commented 5 years ago

Attempting to either run the example code in the README:

index = importmagic.SymbolIndex()
index.get_or_create_index(name='foo', paths=sys.path)

— or attempting to run the same code as it's written in the bin/importmagic script results in the same error in both cases:

Traceback (most recent call last):
  File "/home/brhodes/imagic", line 33, in <module>
    index.get_or_create_index(paths=path, refresh=args.refresh)
AttributeError: 'SymbolIndex' object has no attribute 'get_or_create_index'

I double-checked whether I have the library installed correctly and haven't yet found any problems with my install. Thanks for any hints in getting the library working!

delijati commented 5 years ago

It seams on pypi is a older release. @alecthomas can you release the new version. For now use: pip install -U git+https://github.com/alecthomas/importmagic.git