I am running this code to import a module:
from pm4py.objects.log.util import func as functools
And get this ImportError:
ImportError Traceback (most recent call last)
<ipython-input-15-d14af87451f6> in <module>
1 import pm4py
----> 2 from pm4py.objects.log.util import func as functools
ImportError: cannot import name 'func' from 'pm4py.objects.log.util'
Does someone know how to resolve this?
It is unclear what do you expect from this code and what is func
.
pm4py.objects.log.util
is a python package (as it has an __init__.py
file and has some modules). When you import something from a package, it recursively imports submodules/subpackages, defined in __init__.py
file. According to the pm4py source code, there is no func
name in this file.
If you want to see what names are accessible from pm4py.objects.log.util
, you can do the following:
import pm4py.objects.log.util as utils
print(dir(utils))
Which prints all the names you can access:
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__',
'__name__', '__package__', '__path__', '__spec__', 'artificial',
'basic_filter', 'dataframe_utils', 'filtering_utils',
'get_class_representation', 'get_log_encoded', 'get_prefixes',
'index_attribute', 'insert_classifier', 'interval_lifecycle', 'log',
'pandas_numpy_variants', 'pkgutil', 'sampling', 'sorting',
'split_train_test', 'xes']