kylebgorman / pynini

Read-only mirror of Pynini
http://pynini.opengrm.org
Apache License 2.0
118 stars 27 forks source link

pip install fails on arm64 based linux #70

Closed camiel-genesys closed 9 months ago

camiel-genesys commented 9 months ago

I am not sure if this is covered already in any of the other 3 issues...

I am trying to pip install pynini on an arm64 linux platform. I don't have conda-forge in my case so that wouldn't be an option.

This is the error I am getting:

22.52 Collecting pynini (from -r /tmp/requirements.txt (line 1))                                                                                                                                                                        
22.69   Downloading https://purecloud.jfrog.io/purecloud/api/pypi/pypi/packages/packages/86/63/6a720dbdf4e7358baa2ab206a51693f9c6e83d174179a95539f501bd4a34/pynini-2.1.5.tar.gz (627 kB)                                                
23.28      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 627.6/627.6 kB 1.5 MB/s eta 0:00:00                                                                                                                                                  
27.61   Preparing metadata (setup.py): started
34.56   Preparing metadata (setup.py): finished with status 'error'
34.94   error: subprocess-exited-with-error
34.94   
34.94   × python setup.py egg_info did not run successfully.
34.94   │ exit code: 1
34.94   ╰─> [6 lines of output]
34.94       Traceback (most recent call last):
34.94         File "<string>", line 2, in <module>
34.94         File "<pip-setuptools-caller>", line 34, in <module>
34.94         File "/tmp/pip-install-3ycml0iv/pynini_edc433c4534e4a188f49d21d890b67e3/setup.py", line 22, in <module>
34.94           from Cython.Build import cythonize
34.94       ModuleNotFoundError: No module named 'Cython'
34.94       [end of output]
34.94   
34.94   note: This error originates from a subprocess, and is likely not a problem with pip.
35.04 error: metadata-generation-failed
35.04 
35.04 × Encountered error while generating package metadata.
35.04 ╰─> See above for output.
35.04 
35.04 note: This is an issue with the package mentioned above, not pip.
35.04 hint: See above for details.

Any advise on what to do?

Thanks, Camiel

kylebgorman commented 9 months ago

This is almost surely a duplicate of #30. This will be fixed in the next release via migration to pyproject.toml and such.

camiel-genesys commented 9 months ago

Yeah, I also suspected it is a duplicate, my only worry was that #30 didn't mention the arm64 linux platform. I am saying this because I can pip install perfectly fine on an amd64 linux platform, the problem is specifically related to arm64 in my case.

By the way, do you have some kind of estimation of when the next release will be published?

kylebgorman commented 9 months ago

Probably some time this fall. I work on it as much as I possibly can.

That said, there's an easy fix for you, I think: install Cython first: pip install cython==0.29.17 (I think) and then install this. The error is because setup.py is a Python script which imports Cython, but also installs it...so if you have already installed it, you should be good. pyproject.toml is not a Python script so whatever build system you use with it, it can resolve the dependencies before importing them.

kylebgorman commented 9 months ago

I'm going to close this in favor of #30 but indicate there that it's not platform-specific.

kylebgorman commented 9 months ago

Pynini 2.1.5.post1 should solve the Cython issue, though I can't guarantee your ARM machine will have enough juice to compile it (it's a big project).

camiel-genesys commented 3 months ago

Thanks Kyle! I only got to work on this again now and I have a few questions...

  1. I noticed that you only have 2 versions now: 2.1.6 and 2.1.5.post2. Can I use the latest for this (2.1.6)?
  2. I was working OpenFST 1.8.0, should I use a newer version? I see the latest is 1.8.3.
  3. Also, any advise on how to do this? I have to say I am kind of new to all this... What I am trying to do is:
    • Download the OpenFST source code and compile and install it;
    • Download the Pynini source code and install it;
kylebgorman commented 3 months ago

Hi there. Re: (1) I have all major releases available here if you really need them:

https://www.opengrm.org/twiki/bin/view/GRM/PyniniDownload

Re: (2) I would always recommend just working with the newest Pynini release and the newest OpenFst release. Pynini 2.1.6 compiles against OpenFst 1.8.3 and is unlikely to work with any other release.

Re: (3), yes, that's basically it. You'd follow the instructions on openfst.org (roughly, download and decompress the OpenFst 1.8.3 tarball, navigate into the directory it creates, run./configure --enable-grm then make -j and if that's successful, sudo make install -j) then if you download and decompress (if necessary) the Pynini 2.1.6 tarball, navigate into the directory it creates and run pip install -v . Then wait---and if you're lucky you should have a working installation. Good luck!