Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update grpcio library #873

Closed
oleh-liskovych opened this issue May 24, 2023 · 12 comments
Closed

Update grpcio library #873

oleh-liskovych opened this issue May 24, 2023 · 12 comments

Comments

@oleh-liskovych
Copy link

oleh-liskovych commented May 24, 2023

Chaquopy version

id 'com.chaquo.python' version '14.0.2' apply false
Android Studio Flamingo | 2022.2.1 Patch 1

Relevant parts of your build.gradle file

defaultConfig {
        ndk {
            abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
        }

        python {
            pip {
                install "grpcio==1.50.0"
            }

        }
    }

Describe your issue

Failed to install grcio. Tried many versions of this library

Logs:

 Task :app:generateDebugPythonRequirements
Chaquopy: Installing for arm64-v8a
Looking in indexes: https://pypi.org/simple, https://chaquo.com/pypi-7.0, https://chaquo.com/pypi-13.1
Collecting grpcio==1.50.0
  Using cached grpcio-1.50.0.tar.gz (22.1 MB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3 -S -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sj/x94_cp4s6hv6d3ng10cy624r0000gp/T/pip-install-sn_yzlth/grpcio/setup.py'"'"'; __file__='"'"'/private/var/folders/sj/x94_cp4s6hv6d3ng10cy624r0000gp/T/pip-install-sn_yzlth/grpcio/setup.py'"'"';import chaquopy_monkey; chaquopy_monkey.disable_native();f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --no-user-cfg egg_info --egg-base /private/var/folders/sj/x94_cp4s6hv6d3ng10cy624r0000gp/T/pip-pip-egg-info-8lzllola
         cwd: /private/var/folders/sj/x94_cp4s6hv6d3ng10cy624r0000gp/T/pip-install-sn_yzlth/grpcio/
    Complete output (11 lines):
    ERROR: Command errored out with exit status 1:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/sj/x94_cp4s6hv6d3ng10cy624r0000gp/T/pip-install-sn_yzlth/grpcio/setup.py", line 262, in <module>
        if check_linker_need_libatomic():
      File "/private/var/folders/sj/x94_cp4s6hv6d3ng10cy624r0000gp/T/pip-install-sn_yzlth/grpcio/setup.py", line 209, in check_linker_need_libatomic
        cpp_test = subprocess.Popen(cxx + ['-x', 'c++', '-std=c++14', '-'],
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 966, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1842, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'Chaquopy_cannot_compile_native_code'
    ----------------------------------------
ERROR: Failed to install grpcio==1.50.0 from https://files.pythonhosted.org/packages/71/87/118ed062bba99c54162f9b3a15cc58f018e157fe2f274edd7bc1a8a5bfe2/grpcio-1.50.0.tar.gz#sha256=12b479839a5e753580b5e6053571de14006157f2ef9b71f38c56dc9b23b95ad6.
Failed to install grpcio==1.50.0 from https://files.pythonhosted.org/packages/71/87/118ed062bba99c54162f9b3a15cc58f018e157fe2f274edd7bc1a8a5bfe2/grpcio-1.50.0.tar.gz#sha256=12b479839a5e753580b5e6053571de14006157f2ef9b71f38c56dc9b23b95ad6.

For assistance, please raise an issue at https://github.com/chaquo/chaquopy/issues.
Chaquopy: Exit status 1
@mhsmith
Copy link
Member

mhsmith commented May 24, 2023

If you simply write install "grpcio", then it'll install the newest version available, which is currently 1.39.0.

If you need a newer version, please explain why.

To try building a newer version yourself, follow the instructions here. And if you're successful, please make a pull request so we can add the new version to the public repository.

If anyone else needs a new version of this package, please click the thumbs up button above, and post a comment explaining why you need it.

@oleh-liskovych
Copy link
Author

The actual problem is that I am trying to install "flwr", and build fails on installing flwr's dependency "grpcio" (Failed to install grpcio==1.50.0 from). Than I tried to install it separately just to be sure this is the cause. This install "grpcio" is working. How to deal with install "flwr"? I get: Failed to install grpcio!=1.52.0,<2.0.0,>=1.48.2 from

@oleh-liskovych
Copy link
Author

I tried different versions of flwr. The newest working version is 0.18.0. I need some functionality from much newer versions

@mhsmith mhsmith changed the title Failed to install grpcio library Update grpcio library May 24, 2023
@mhsmith
Copy link
Member

mhsmith commented May 24, 2023

OK, in that case you can try building a newer version of grpcio by following the instructions here.

@oleh-liskovych
Copy link
Author

Is there a list of available versions of libraries, or any way to see available versions for specific library?

@mhsmith
Copy link
Member

mhsmith commented May 24, 2023

Yes: here and here. And the recipes for these versions can be found in server/pypi/packages, or its history.

@oleh-liskovych
Copy link
Author

Thanks alot. I'll try to build grpcio, and close issue in few days

@mhsmith
Copy link
Member

mhsmith commented May 29, 2023

If you managed to build the new version, please make a PR so we can add it to the public repository. Either way, let's leave this issue open for now in case other people have the same question.

@theharshprasad
Copy link

theharshprasad commented Jun 21, 2023

@mhsmith I am facing the same issue while installing "flwr" and instructions for building new GRPCIO is not clear. Can you provide any clear instruction or tutorial that would help me

@mhsmith
Copy link
Member

mhsmith commented Jun 21, 2023

According to this comment, the newest working version of flwr is 0.18.0. Does that work for your app?

If not, you can build a new grpcio version by following these instructions.

@mhsmith
Copy link
Member

mhsmith commented Dec 9, 2023

grpcio version 1.59.3 is now in the public repository for Python 3.8 - 3.12.

@mhsmith
Copy link
Member

mhsmith commented Dec 9, 2023

The newest version of flwr that can be installed is now 1.4.0. Newer versions would require us to update pycryptodome (#807) and cryptography (#657).

For Python 3.8 you'll also need to add the pypi-extra repository:

                install "flwr==1.4.0"
                options "--extra-index-url", "https://chaquo.com/pypi-extra/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants