Python trackpy attribute error

270 Views Asked by At

I'm trying to use the python library trackpy to trace some particles of wax. At the beginning of my code when I import the necessary libraries,

import numpy as np
import pandas as pd
from pandas import DataFrame, Series  # for convenience

import pims
import trackpy as tp

I get the following attribute error:

AttributeError: module 'inspect' has no attribute 'getmoduleinfo'

which occurs in line 8 of this block of code from the file try_numba.py from the trackpy library.

def __init__(self, func, fallback=None, autojit_kw=None):
    self.func = func
    # This covers a Python 2/3 change not covered by six
    try:
        self.func_name = func.__name__
    except AttributeError:
        self.func_name = func.func_name
    module_name = inspect.getmoduleinfo(
        six.get_function_globals(func)['__file__']).name
    module_name = '.'.join(['trackpy', module_name])
    self.module_name = module_name
    self.autojit_kw = autojit_kw
    if fallback is not None:
        self.ordinary = fallback
    else:
        self.ordinary = func

Anyone know what's going on? The majority of my code is dependent on this library.

0

There are 0 best solutions below