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

Can't pip install curl_cffi - Getting Unsupported arch error (i686 musl build) - Support for the iSH iOS app #344

Open
plia7 opened this issue Jul 8, 2024 · 3 comments
Assignees
Labels
platform Platform related requests

Comments

@plia7
Copy link

plia7 commented Jul 8, 2024

Hello,

I have iSH version 1.3.2 (Alpine Linux x86 emulator) on my iPhone along with python and pip installed in it.
Which I used to install the g4f python package - The official gpt4free repository | various collection of powerful language models.
They recently upgraded to version 0.3.2.1 and it appears to use the curl_cffi python package.

I tried to install it in this order:

apk add gcc musl-dev libffi-dev libcurl libcurl-dev
pip install --upgrade pip setuptools wheel
pip install curl_cffi

When I try to install it, I get an error:

pip install curl_cffi
Collecting curl_cffi
  Downloading curl_cffi-0.7.0.tar.gz (132 kB)
     ━━━━━━━━━━━━━ 132.9/132.9   430.3 kB/s eta 0:00:00
                   kB                                  
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [37 lines of output]
      Traceback (most recent call last):
        File "/usr/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-vjq7x6k4/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "/tmp/pip-build-env-vjq7x6k4/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-vjq7x6k4/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 16, in <module>
        File "/tmp/pip-build-env-vjq7x6k4/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 103, in setup

return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-vjq7x6k4/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 146, in setup
          _setup_distribution = dist = klass(attrs)
        File "/tmp/pip-build-env-vjq7x6k4/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 307, in _init_
          _Distribution.__init__(self, dist_attrs)
        File "/tmp/pip-build-env-vjq7x6k4/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 286, in _init_
          self.finalize_options()
        File "/tmp/pip-build-env-vjq7x6k4/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 659, in finalize_options
          ep(self)
        File "/tmp/pip-build-env-vjq7x6k4/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 679, in _finalize_setup_keywords
          ep.load()(self, ep.name, value)
        File "/tmp/pip-build-env-vjq7x6k4/overlay/lib/python3.9/site-packages/cffi/setuptools_ext.py", line 216, in cffi_modules
          add_cffi_module(dist, cffi_module)
        File "/tmp/pip-build-env-vjq7x6k4/overlay/lib/python3.9/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
          execfile(build_file_name, mod_vars)
        File "/tmp/pip-build-env-vjq7x6k4/overlay/lib/python3.9/site-packages/cffi/setuptools_ext.py", line 25, in execfile
          exec(code, glob, glob)
        File "scripts/build.py", line 47, in <module>
          arch = detect_arch()
        File "scripts/build.py", line 44, in detect_arch
          raise Exception(f"Unsupported arch: {uname}")
      Exception: Unsupported arch: uname_result(system='Linux', node='iPhone', release='4.20.69-ish', version='SUPER AWESOME May 20 2023 23:41:32', machine='i686')
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Which error is basically this:
Exception: Unsupported arch: uname_result(system='Linux', node='iPhone', release='4.20.69-ish', version='SUPER AWESOME May 20 2023 23:41:32', machine='i686')

I also tried to set export ARCHFLAGS="-arch i686" before installing it and trying to install an older version pip install curl_cffi==0.6.4
but I still get the same error.

So I can't run g4f anymore in the latest version.
Is there a way to install curl_cffi python package without getting this error in iSH?

Thanks.

@plia7 plia7 added the bug Something isn't working label Jul 8, 2024
@perkfly
Copy link
Collaborator

perkfly commented Jul 8, 2024

There is no i686 musl build of curl-impersonate for Linux. I will try to add that in the future.

@plia7 plia7 changed the title Can't pip install curl_cffi - Getting Unsupported arch error Can't pip install curl_cffi - Getting Unsupported arch error (i686 musl build) Jul 8, 2024
@plia7
Copy link
Author

plia7 commented Jul 9, 2024

There is no i686 musl build of curl-impersonate for Linux. I will try to add that in the future.

Do you have an ETA when and how much time it would take to add it (level of effort)?
Thank you.

@perkfly
Copy link
Collaborator

perkfly commented Jul 9, 2024

There is no ETA for this, I tried to cross compile for x86-linux-musl on CI, but no luck.

@perkfly perkfly added the upstream Related to upstream libcurl-impersonate label Jul 23, 2024
@lexiforest lexiforest added platform Platform related requests and removed bug Something isn't working upstream Related to upstream libcurl-impersonate labels Sep 24, 2024
@plia7 plia7 changed the title Can't pip install curl_cffi - Getting Unsupported arch error (i686 musl build) Can't pip install curl_cffi - Getting Unsupported arch error (i686 musl build) - Support for thr iSH iOS app Nov 8, 2024
@plia7 plia7 changed the title Can't pip install curl_cffi - Getting Unsupported arch error (i686 musl build) - Support for thr iSH iOS app Can't pip install curl_cffi - Getting Unsupported arch error (i686 musl build) - Support for the iSH iOS app Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform Platform related requests
Projects
None yet
Development

No branches or pull requests

3 participants