Bergvca / string_grouper

Super Fast String Matching in Python
MIT License
364 stars 76 forks source link

[question] How to import string_grouper_utils? #61

Open MauKruisheer opened 3 years ago

MauKruisheer commented 3 years ago

Hi all, I think this is a very simple question, but how can one import the string_grouper_utils module? I've installed string_grouper via pip install, but cannot seem to access the modules within string_grouper_utils, such as new_group_rep_by_highest_weight. Anyone?

ParticularMiner commented 3 years ago

@MauKruisheer

from string_grouper_utils import new_group_rep_by_highest_weight, \
    new_group_rep_by_earliest_timestamp, new_group_rep_by_completeness

(As detailed in this link.)

MauKruisheer commented 3 years ago

@ParticularMiner thanks for the input. I tried that, but received this error: ModuleNotFoundError: No module named 'string_grouper_utils'

Somehow string_grouper works, but string_grouper_utils cannot be found

ParticularMiner commented 3 years ago

@MauKruisheer

You are right. It seems you've discovered a bug as I'm also able to reproduce this error. I'm not sure how this bug crept in, since it has always worked before. Perhaps this is due to a recent upgrade of pip.

Anyway I've also found a fix for this but I'm not sure how long it will take to reach the main branch.

If you are willing to download the package files from GitHub instead of pypi.org then I could help you. Let me know if you are willing then I'll direct you to the relevant branch. Otherwise you'd have to wait until string_grouper is updated on pypi.org and that could take a while.

Meanwhile, many thanks for bringing this to our attention!

MauKruisheer commented 3 years ago

Okay, great. Thanks for the quick feedback. I'll download it directly from Github, no problem. Which branch should I refer to?

ParticularMiner commented 3 years ago

@MauKruisheer

The branch can be found at this link.

  1. Download the package files by, for example, clicking on the link "Download zip" under the "Code" button (or, if you use git, you may alternatively clone the entire repository into your local git),
  2. navigate to the folder/directory where the setup.py script file is and
  3. enter the following command at your command prompt:
pip install .

This should install string_grouper in the same location where your other python packages are.

Kindly let me know afterwards if this solves your problem.

Cheers!