JoshData / fast_diff_match_patch

Python package for Google's diff-match-patch native C++ implementation.
https://pypi.org/project/fast-diff-match-patch/
Apache License 2.0
73 stars 27 forks source link

PIP install not working #19

Closed pratyushmittal closed 2 years ago

pratyushmittal commented 2 years ago

Hey, somehow the pip install is not working on Python 3.10.

I tried it on Linux as well as MacOS (M1).

Both Linux and MacOS give the same error:

$ pip install fast-diff-match-patch

ERROR: Could not find a version that satisfies the requirement fast-diff-match-patch (from versions: none)
ERROR: No matching distribution found for fast-diff-match-patch

I also tried fast_diff_match_patch. This too gives the same error:

$ pip install fast_diff_match_patch

ERROR: Could not find a version that satisfies the requirement fast_diff_match_patch (from versions: none)
ERROR: No matching distribution found for fast_diff_match_patch

How can I help in fixing the above?

pratyushmittal commented 2 years ago

I cloned the repository and did pip install -e .. This works fine on Python 3.10. I also tried the library in Python shell.

So the support for Python 3.10 is okay, somehow pip install fast-diff-match-patch or pip install fast_diff_match_patch is not working.

JoshData commented 2 years ago

It works for me. I'm not very good at Python packaging stuff so I unfortunately don't have any ideas coming to mind about why it might not work for you.

$ python3 -V
Python 3.10.4
$ pip3 install --upgrade fast_diff_match_patch
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: fast_diff_match_patch in ./.local/lib/python3.10/site-packages (2.0.0.post1)
Collecting fast_diff_match_patch
  Downloading fast_diff_match_patch-2.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (762 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 762.2/762.2 KB 18.2 MB/s eta 0:00:00
Installing collected packages: fast_diff_match_patch
  Attempting uninstall: fast_diff_match_patch
    Found existing installation: fast-diff-match-patch 2.0.0.post1
    Uninstalling fast-diff-match-patch-2.0.0.post1:
      Successfully uninstalled fast-diff-match-patch-2.0.0.post1
Successfully installed fast_diff_match_patch-2.0.1
pratyushmittal commented 2 years ago

Hey @JoshData, thanks for having a look.

I checked the logs. The installation is failing because it couldn't find the wheels for arm64 and macosx_12_0_universal2 machines.

I checked the built wheels on https://pypi.org/project/fast-diff-match-patch/#files: CleanShot 2022-07-14 at 11 06 02@2x

I found the compatible tags by running pip debug --verbose. The install works if we have x86_64 in the compatible tags. These tags are not added if we use Amazon's silicon (on AWS) or MacOSX-M1 without backward compatibility.

I will try to create a pull request to fix the above.

Thanks again.