Skip to content

Import errors and solutions for running TreeXAlgorithm #128

@hagreven

Description

@hagreven

Thank you for the great work! I’ve been testing the improved TreeXAlgorithm, but ran into a few issues when installing the required packages using:

pip install pointtree circle_detection

This led to the following import errors:

cannot import name 'TreeXAlgorithm' from 'pointtree.instance_segmentation'
cannot import name 'MEstimator' from 'circle_detection'

It seems that the versions currently available on PyPI are not up-to-date and missing recent changes. To resolve this, I cloned the latest versions of both repositories and installed them as editable modules:

git clone https://github.com/ai4trees/pointtree.git
pip install -e pointtree
git clone https://github.com/josafatburmeister/circle_detection.git
pip install -e circle_detection

This resolved the initial import errors. However, I then encountered another:

cannot import name 'TreeXPresetTLS' from 'pointtree.instance_segmentation'

This is caused by a missing import in pointtree/instance_segmentation/__init__.py.
Adding the following line resolves it:

from .tree_x_presets import *

With that everything else ran smoothly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions