-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
I cannot install G4F in termux using the command: pip install g4f #1107
Comments
for curl_cffi you need to build libcurl-impersonate-chrome.so |
you might use another environment for g4f |
@xtekky termux without chroot/proot, no problems with installation |
@romanovj when
|
@George-Seven open curl-impersonate/boringssl/ssl/test/handshake_util.h |
@romanovj after the changes build continues, then later gives -
|
@George-Seven rename folder /data/data/com.termux/files/usr/include/openssl |
@romanovj the
|
most dumb way:
now you are ready to build curl_cffi, don't forget to return original curl headers |
Thanks so much, it's working perfectly👍 Tested the GUI with -
And it's up on -
and successfully running natively in Termux. |
Can you share your libcurl-impersonate-chrome.so? |
Finally compiled curl-impersonate. If anyone needs, here are the files that made g4f work:
|
In Termux/PyDroid3 environment, dependencies of I found that in Termux we can use the g4f docker image with dependencies already baked-in, without root. To streamline it more - |
@George-Seven this thead is 6 month old. Todays you can run g4f on termux/PyDroid |
I still can′t install it on Termux. I had to install Rust. Then xml2. Then when I run pip install g4f[all] Termux crashes when it′s building lxml wheel. |
@richardhttps |
I'm trying to install g4f, but instead of installing I get this error:
DEPRECATION: Loading egg at /data/data/com.termux/files/usr/lib/python3.11/site-packages/g4f-0.1.6.8-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 DEPRECATION: Loading egg at /data/data/com.termux/files/usr/lib/python3.11/site-packages/duckduckgo_search-3.9.3-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 DEPRECATION: Loading egg at /data/data/com.termux/files/usr/lib/python3.11/site-packages/PyExecJS-1.5.1-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 DEPRECATION: Loading egg at /data/data/com.termux/files/usr/lib/python3.11/site-packages/typing_extensions-4.8.0-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 DEPRECATION: Loading egg at /data/data/com.termux/files/usr/lib/python3.11/site-packages/Flask_Cors-4.0.0-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 DEPRECATION: Loading egg at /data/data/com.termux/files/usr/lib/python3.11/site-packages/flask-3.0.0-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 DEPRECATION: Loading egg at /data/data/com.termux/files/usr/lib/python3.11/site-packages/Js2Py-0.74-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 DEPRECATION: Loading egg at /data/data/com.termux/files/usr/lib/python3.11/site-packages/websockets-11.0.3-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 DEPRECATION: Loading egg at /data/data/com.termux/files/usr/lib/python3.11/site-packages/browser_cookie3-0.19.1-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 Requirement already satisfied: g4f in /data/data/com.termux/files/usr/lib/python3.11/site-packages/g4f-0.1.6.8-py3.11.egg (0.1.6.8) Requirement already satisfied: requests in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from g4f) (2.31.0) Collecting pycryptodome (from g4f) Using cached pycryptodome-3.19.0-cp35-abi3-linux_aarch64.whl Collecting curl_cffi (from g4f) Using cached curl_cffi-0.5.9.tar.gz (32 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: aiohttp in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from g4f) (3.8.5) Requirement already satisfied: certifi in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from g4f) (2023.7.22) Requirement already satisfied: browser_cookie3 in /data/data/com.termux/files/usr/lib/python3.11/site-packages/browser_cookie3-0.19.1-py3.11.egg (from g4f) (0.19.1) Requirement already satisfied: websockets in /data/data/com.termux/files/usr/lib/python3.11/site-packages/websockets-11.0.3-py3.11.egg (from g4f) (11.0.3) Requirement already satisfied: js2py in /data/data/com.termux/files/usr/lib/python3.11/site-packages/Js2Py-0.74-py3.11.egg (from g4f) (0.74) Requirement already satisfied: flask in /data/data/com.termux/files/usr/lib/python3.11/site-packages/flask-3.0.0-py3.11.egg (from g4f) (3.0.0) Requirement already satisfied: flask-cors in /data/data/com.termux/files/usr/lib/python3.11/site-packages/Flask_Cors-4.0.0-py3.11.egg (from g4f) (4.0.0) Requirement already satisfied: typing-extensions in /data/data/com.termux/files/usr/lib/python3.11/site-packages/typing_extensions-4.8.0-py3.11.egg (from g4f) (4.8.0) Requirement already satisfied: PyExecJS in /data/data/com.termux/files/usr/lib/python3.11/site-packages/PyExecJS-1.5.1-py3.11.egg (from g4f) (1.5.1) Requirement already satisfied: duckduckgo-search in /data/data/com.termux/files/usr/lib/python3.11/site-packages/duckduckgo_search-3.9.3-py3.11.egg (from g4f) (3.9.3) Requirement already satisfied: attrs>=17.3.0 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from aiohttp->g4f) (23.1.0) Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from aiohttp->g4f) (3.3.0) Requirement already satisfied: multidict<7.0,>=4.5 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from aiohttp->g4f) (6.0.4) Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from aiohttp->g4f) (4.0.3) Requirement already satisfied: yarl<2.0,>=1.0 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from aiohttp->g4f) (1.9.2) Requirement already satisfied: frozenlist>=1.1.1 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from aiohttp->g4f) (1.4.0) Requirement already satisfied: aiosignal>=1.1.2 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from aiohttp->g4f) (1.3.1) Collecting lz4 (from browser_cookie3->g4f) Using cached lz4-4.3.2-cp311-cp311-linux_aarch64.whlCollecting pycryptodomex (from browser_cookie3->g4f) Using cached pycryptodomex-3.19.0-cp35-abi3-linux_aarch64.whl Collecting jeepney (from browser_cookie3->g4f) Using cached jeepney-0.8.0-py3-none-any.whl (48 kB) Requirement already satisfied: cffi>=1.12.0 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from curl_cffi->g4f) (1.14.6) Collecting aiofiles>=23.2.1 (from duckduckgo-search->g4f) Using cached aiofiles-23.2.1-py3-none-any.whl.metadata (9.7 kB) Collecting click>=8.1.7 (from duckduckgo-search->g4f) Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB) Collecting lxml>=4.9.3 (from duckduckgo-search->g4f) Using cached lxml-4.9.3-cp311-cp311-linux_aarch64.whl Requirement already satisfied: httpx>=0.25.0 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) (0.25.0) Collecting Werkzeug>=3.0.0 (from flask->g4f) Using cached werkzeug-3.0.0-py3-none-any.whl.metadata (4.1 kB) Collecting Jinja2>=3.1.2 (from flask->g4f) Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB) Collecting itsdangerous>=2.1.2 (from flask->g4f) Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB) Collecting blinker>=1.6.2 (from flask->g4f) Using cached blinker-1.6.3-py3-none-any.whl.metadata (1.9 kB) Collecting tzlocal>=1.2 (from js2py->g4f) Using cached tzlocal-5.1-py3-none-any.whl.metadata (16 kB) Requirement already satisfied: six>=1.10 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from js2py->g4f) (1.16.0) Collecting pyjsparser>=2.5.1 (from js2py->g4f) Using cached pyjsparser-2.7.1-py3-none-any.whl Requirement already satisfied: idna<4,>=2.5 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from requests->g4f) (3.4) Requirement already satisfied: urllib3<3,>=1.21.1 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from requests->g4f) (2.0.5) Requirement already satisfied: pycparser in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from cffi>=1.12.0->curl_cffi->g4f) (2.21) Requirement already satisfied: httpcore<0.19.0,>=0.18.0 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from httpx>=0.25.0->httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) (0.18.0) Requirement already satisfied: sniffio in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from httpx>=0.25.0->httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) (1.3.0) Collecting brotli (from httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) Using cached Brotli-1.1.0-cp311-cp311-linux_aarch64.whl Collecting h2<5,>=3 (from httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) Using cached h2-4.1.0-py3-none-any.whl (57 kB) Collecting socksio==1.* (from httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) Using cached socksio-1.0.0-py3-none-any.whl (12 kB) Collecting MarkupSafe>=2.0 (from Jinja2>=3.1.2->flask->g4f) Using cached MarkupSafe-2.1.3-cp311-cp311-linux_aarch64.whl Collecting hyperframe<7,>=6.0 (from h2<5,>=3->httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) Using cached hyperframe-6.0.1-py3-none-any.whl (12 kB) Collecting hpack<5,>=4.0 (from h2<5,>=3->httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) Using cached hpack-4.0.0-py3-none-any.whl (32 kB) Requirement already satisfied: anyio<5.0,>=3.0 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from httpcore<0.19.0,>=0.18.0->httpx>=0.25.0->httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) (4.0.0) Requirement already satisfied: h11<0.15,>=0.13 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from httpcore<0.19.0,>=0.18.0->httpx>=0.25.0->httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) (0.14.0) Using cached aiofiles-23.2.1-py3-none-any.whl (15 kB) Using cached blinker-1.6.3-py3-none-any.whl (13 kB) Using cached click-8.1.7-py3-none-any.whl (97 kB) Using cached tzlocal-5.1-py3-none-any.whl (21 kB) Using cached werkzeug-3.0.0-py3-none-any.whl (226 kB) Building wheels for collected packages: curl_cffi Building wheel for curl_cffi (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for curl_cffi (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [92 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-aarch64-cpython-311 creating build/lib.linux-aarch64-cpython-311/curl_cffi copying curl_cffi/__init__.py -> build/lib.linux-aarch64-cpython-311/curl_cffi copying curl_cffi/aio.py -> build/lib.linux-aarch64-cpython-311/curl_cffi copying curl_cffi/build.py -> build/lib.linux-aarch64-cpython-311/curl_cffi copying curl_cffi/const.py -> build/lib.linux-aarch64-cpython-311/curl_cffi copying curl_cffi/curl.py -> build/lib.linux-aarch64-cpython-311/curl_cffi creating build/lib.linux-aarch64-cpython-311/curl_cffi/requests copying curl_cffi/requests/__init__.py -> build/lib.linux-aarch64-cpython-311/curl_cffi/requests copying curl_cffi/requests/cookies.py -> build/lib.linux-aarch64-cpython-311/curl_cffi/requests copying curl_cffi/requests/errors.py -> build/lib.linux-aarch64-cpython-311/curl_cffi/requests copying curl_cffi/requests/headers.py -> build/lib.linux-aarch64-cpython-311/curl_cffi/requests copying curl_cffi/requests/models.py -> build/lib.linux-aarch64-cpython-311/curl_cffi/requests copying curl_cffi/requests/session.py -> build/lib.linux-aarch64-cpython-311/curl_cffi/requests running egg_info writing curl_cffi.egg-info/PKG-INFO writing dependency_links to curl_cffi.egg-info/dependency_links.txt writing requirements to curl_cffi.egg-info/requires.txt writing top-level names to curl_cffi.egg-info/top_level.txt reading manifest file 'curl_cffi.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'curl_cffi/cacert.pem' warning: no files found matching 'curl_cffi/_wrapper.*' warning: no files found matching 'curl_cffi/include/curl/*' adding license file 'LICENSE' writing manifest file 'curl_cffi.egg-info/SOURCES.txt' /data/data/com.termux/files/usr/tmp/pip-build-env-e9khg1zz/overlay/lib/python3.11/site-packages/setuptools/command/build_py.py:204: _Warning: Package 'curl_cffi.ffi' is absent from the
packagesconfiguration. !! ******************************************************************************** ############################ # Package would be ignored # ############################ Python recognizes 'curl_cffi.ffi' as an importable package[^1], but it is absent from setuptools'
packagesconfiguration. This leads to an ambiguous overall configuration. If you want to distribute this package, please make sure that 'curl_cffi.ffi' is explicitly added to the
packagesconfiguration field. Alternatively, you can also rely on setuptools' discovery methods (for example by using
find_namespace_packages(...)/
find_namespace:instead of
find_packages(...)/
find:). You can read more about "package discovery" on setuptools documentation page: - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html If you don't want 'curl_cffi.ffi' to be distributed and are already explicitly excluding 'curl_cffi.ffi' via
find_namespace_packages(...)/find_namespaceor
find_packages(...)/find, you can try to use
exclude_package_data, or
include-package-data=Falsein combination with a more fine grained
package-dataconfiguration. You can read more about "package data files" on setuptools documentation page: - https://setuptools.pypa.io/en/latest/userguide/datafiles.html [^1]: For Python, any directory (with suitable naming) can be imported, even if it does not contain any
.pyfiles. On the other hand, currently there is no concept of package data directory, all directories are treated like packages. ******************************************************************************** !! check.warn(importable) creating build/lib.linux-aarch64-cpython-311/curl_cffi/ffi copying curl_cffi/ffi/cdef.c -> build/lib.linux-aarch64-cpython-311/curl_cffi/ffi copying curl_cffi/ffi/shim.c -> build/lib.linux-aarch64-cpython-311/curl_cffi/ffi copying curl_cffi/ffi/shim.h -> build/lib.linux-aarch64-cpython-311/curl_cffi/ffi running build_ext generating cffi module 'build/temp.linux-aarch64-cpython-311/curl_cffi._wrapper.c' creating build/temp.linux-aarch64-cpython-311 building 'curl_cffi._wrapper' extension creating build/temp.linux-aarch64-cpython-311/build creating build/temp.linux-aarch64-cpython-311/build/temp.linux-aarch64-cpython-311 creating build/temp.linux-aarch64-cpython-311/curl_cffi creating build/temp.linux-aarch64-cpython-311/curl_cffi/ffi aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -Icurl_cffi/include -Icurl_cffi/ffi -I/data/data/com.termux/files/usr/include/python3.11 -c build/temp.linux-aarch64-cpython-311/curl_cffi._wrapper.c -o build/temp.linux-aarch64-cpython-311/build/temp.linux-aarch64-cpython-311/curl_cffi._wrapper.o build/temp.linux-aarch64-cpython-311/curl_cffi._wrapper.c:888:10: error: call to undeclared function 'curl_easy_impersonate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 888 | return curl_easy_impersonate(x0, x1, x2); | ^ build/temp.linux-aarch64-cpython-311/curl_cffi._wrapper.c:932:14: error: call to undeclared function 'curl_easy_impersonate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 932 | { result = curl_easy_impersonate(x0, x1, x2); } | ^ 2 errors generated. error: command '/data/data/com.termux/files/usr/bin/aarch64-linux-android-clang' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for curl_cffi Failed to build curl_cffi ERROR: Could not build wheels for curl_cffi, which is required to install pyproject.toml-based projects
Python version - 3.11.6
Pip version - 23.3
All my requirements:
aiogram==2.23.1 aiohttp==3.8.5 aiosignal==1.3.1 anyio==4.0.0 asttokens==2.4.0 async-timeout==4.0.3 attrs==23.1.0 Babel==2.9.1 browser-cookie3==0.19.1 certifi==2023.7.22 cffi==1.14.6 charset-normalizer==3.3.0 colorama==0.4.6 config==0.5.1 discord==2.3.2 discord.py==2.3.2 docopt==0.6.2
duckduckgo-search==3.9.3 et-xmlfile==1.1.0
executing==2.0.0 fake-useragent==1.3.0
Flask==3.0.0 Flask-Cors==4.0.0 frozenlist==1.4.0 g4f==0.1.6.8 GrabzIt==3.5.2 h11==0.14.0 httpcore==0.18.0 httpx==0.25.0 icecream==2.1.3 idna==3.4 Js2Py==0.74 magic-filter==1.0.12 markdown-it-py==3.0.0 mdurl==0.1.2 multidict==6.0.4 openai==0.28.1 openpyxl==3.1.2 pick==2.2.0 psm==0.1.2 pycparser==2.21 PyExecJS==1.5.1 Pygments==2.16.1 pyTelegramBotAPI==4.14.0 python-telegram-bot==20.6 pytz==2023.3.post1 requests==2.31.0 rich==13.6.0 simple-term-menu==1.6.1 six==1.16.0 sniffio==1.3.0 telebot==0.0.5 telegram==0.0.1 tqdm==4.66.1 typing_extensions==4.8.0 urllib3==2.0.5 websockets==11.0.3 yarl==1.9.2
The text was updated successfully, but these errors were encountered: