xtekky / gpt4free

The official gpt4free repository | various collection of powerful language models
https://g4f.ai
GNU General Public License v3.0
61.48k stars 13.33k forks source link

Can't install g4f because curl-cffi on alpine #1171

Closed thanhtoan1196 closed 1 year ago

thanhtoan1196 commented 1 year ago

Known Issues

Bug description What did I do:

apk add curl-dev libffi-dev
pip3 install g4f

Logs

# pip3 install g4f
Collecting g4f
  Downloading g4f-0.1.7.7-py3-none-any.whl (266 kB)
     |████████████████████████████████| 266 kB 10.1 MB/s
Collecting pycryptodome
  Downloading pycryptodome-3.19.0.tar.gz (4.8 MB)
     |████████████████████████████████| 4.8 MB 163.4 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Collecting browser-cookie3
  Downloading browser_cookie3-0.19.1-py3-none-any.whl (14 kB)
Collecting curl-cffi
  Downloading curl_cffi-0.5.9.tar.gz (32 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting typing-extensions
  Downloading typing_extensions-4.8.0-py3-none-any.whl (31 kB)
Collecting aiohttp
  Downloading aiohttp-3.8.6.tar.gz (7.4 MB)
     |████████████████████████████████| 7.4 MB 155.6 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Requirement already satisfied: numpy in /usr/lib/python3.8/site-packages (from g4f) (1.24.4)
Requirement already satisfied: flask in /usr/lib/python3.8/site-packages (from g4f) (2.3.3)
Collecting flask-cors
  Downloading Flask_Cors-4.0.0-py2.py3-none-any.whl (14 kB)
Requirement already satisfied: websockets in /usr/lib/python3.8/site-packages (from g4f) (11.0.3)
Collecting PyExecJS
  Downloading PyExecJS-1.5.1.tar.gz (13 kB)
Requirement already satisfied: requests in /usr/lib/python3.8/site-packages (from g4f) (2.25.1)
Collecting loguru
  Downloading loguru-0.7.2-py3-none-any.whl (62 kB)
     |████████████████████████████████| 62 kB 9.4 MB/s
Collecting nest-asyncio
  Downloading nest_asyncio-1.5.8-py3-none-any.whl (5.3 kB)
Collecting platformdirs
  Downloading platformdirs-3.11.0-py3-none-any.whl (17 kB)
Requirement already satisfied: werkzeug in /usr/lib/python3.8/site-packages (from g4f) (2.3.7)
Collecting pillow
  Downloading Pillow-10.1.0.tar.gz (50.8 MB)
     |████████████████████████████████| 50.8 MB 159.0 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Requirement already satisfied: waitress in /usr/lib/python3.8/site-packages (from g4f) (2.1.2)
Collecting tiktoken
  Downloading tiktoken-0.5.1.tar.gz (32 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting js2py
  Downloading Js2Py-0.74-py3-none-any.whl (1.0 MB)
     |████████████████████████████████| 1.0 MB 149.0 MB/s
Collecting duckduckgo-search
  Downloading duckduckgo_search-3.9.3-py3-none-any.whl (25 kB)
Requirement already satisfied: certifi in /usr/lib/python3.8/site-packages (from g4f) (2023.7.22)
Collecting frozenlist>=1.1.1
  Downloading frozenlist-1.4.0.tar.gz (90 kB)
     |████████████████████████████████| 90 kB 54.9 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting charset-normalizer<4.0,>=2.0
  Downloading charset_normalizer-3.3.1-py3-none-any.whl (48 kB)
     |████████████████████████████████| 48 kB 33.4 MB/s
Collecting yarl<2.0,>=1.0
  Downloading yarl-1.9.2.tar.gz (184 kB)
     |████████████████████████████████| 184 kB 148.4 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting multidict<7.0,>=4.5
  Downloading multidict-6.0.4.tar.gz (51 kB)
     |████████████████████████████████| 51 kB 579 kB/s
  Installing build dependencies ... done
  WARNING: Missing build requirements in pyproject.toml for multidict<7.0,>=4.5 from https://files.pythonhosted.org/packages/4a/15/bd620f7a6eb9aa5112c4ef93e7031bcd071e0611763d8e17706ef8ba65e0/multidict-6.0.4.tar.gz#sha256=3666906492efb76453c0e7b97f2cf459b0682e7402c0489a95484965dbc1da49 (from aiohttp->g4f).
  WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'wheel'.
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Collecting attrs>=17.3.0
  Downloading attrs-23.1.0-py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 53.1 MB/s
Collecting aiosignal>=1.1.2
  Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting async-timeout<5.0,>=4.0.0a3
  Downloading async_timeout-4.0.3-py3-none-any.whl (5.7 kB)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3.8/site-packages (from yarl<2.0,>=1.0->aiohttp->g4f) (3.1)
Requirement already satisfied: pycryptodomex in /usr/lib/python3.8/site-packages (from browser-cookie3->g4f) (3.19.0)
Collecting jeepney
  Downloading jeepney-0.8.0-py3-none-any.whl (48 kB)
     |████████████████████████████████| 48 kB 39.1 MB/s
Collecting lz4
  Downloading lz4-4.3.2.tar.gz (170 kB)
     |████████████████████████████████| 170 kB 152.0 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting cffi>=1.12.0
  Using cached cffi-1.16.0-cp38-cp38-linux_x86_64.whl
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Requirement already satisfied: lxml>=4.9.3 in /usr/lib/python3.8/site-packages (from duckduckgo-search->g4f) (4.9.3)
Collecting aiofiles>=23.2.1
  Downloading aiofiles-23.2.1-py3-none-any.whl (15 kB)
Requirement already satisfied: click>=8.1.7 in /usr/lib/python3.8/site-packages (from duckduckgo-search->g4f) (8.1.7)
Requirement already satisfied: httpx[brotli,http2,socks]>=0.25.0 in /usr/lib/python3.8/site-packages (from duckduckgo-search->g4f) (0.25.0)
Requirement already satisfied: sniffio in /usr/lib/python3.8/site-packages (from httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) (1.3.0)
Requirement already satisfied: httpcore<0.19.0,>=0.18.0 in /usr/lib/python3.8/site-packages (from httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) (0.18.0)
Collecting socksio==1.*
  Downloading socksio-1.0.0-py3-none-any.whl (12 kB)
Collecting h2<5,>=3
  Downloading h2-4.1.0-py3-none-any.whl (57 kB)
     |████████████████████████████████| 57 kB 34.3 MB/s
Requirement already satisfied: brotli in /usr/lib/python3.8/site-packages (from httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) (1.1.0)
Collecting hpack<5,>=4.0
  Downloading hpack-4.0.0-py3-none-any.whl (32 kB)
Collecting hyperframe<7,>=6.0
  Downloading hyperframe-6.0.1-py3-none-any.whl (12 kB)
Requirement already satisfied: h11<0.15,>=0.13 in /usr/lib/python3.8/site-packages (from httpcore<0.19.0,>=0.18.0->httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) (0.14.0)
Requirement already satisfied: anyio<5.0,>=3.0 in /usr/lib/python3.8/site-packages (from httpcore<0.19.0,>=0.18.0->httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) (4.0.0)
Requirement already satisfied: exceptiongroup>=1.0.2 in /usr/lib/python3.8/site-packages (from anyio<5.0,>=3.0->httpcore<0.19.0,>=0.18.0->httpx[brotli,http2,socks]>=0.25.0->duckduckgo-search->g4f) (1.1.3)
Requirement already satisfied: importlib-metadata>=3.6.0 in /usr/lib/python3.8/site-packages (from flask->g4f) (6.8.0)
Requirement already satisfied: Jinja2>=3.1.2 in /usr/lib/python3.8/site-packages (from flask->g4f) (3.1.2)
Requirement already satisfied: blinker>=1.6.2 in /usr/lib/python3.8/site-packages (from flask->g4f) (1.6.2)
Requirement already satisfied: itsdangerous>=2.1.2 in /usr/lib/python3.8/site-packages (from flask->g4f) (2.1.2)
Requirement already satisfied: zipp>=0.5 in /usr/lib/python3.8/site-packages (from importlib-metadata>=3.6.0->flask->g4f) (3.16.2)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/lib/python3.8/site-packages (from Jinja2>=3.1.2->flask->g4f) (2.1.3)
Requirement already satisfied: tzlocal>=1.2 in /usr/lib/python3.8/site-packages (from js2py->g4f) (5.0.1)
Collecting pyjsparser>=2.5.1
  Downloading pyjsparser-2.7.1.tar.gz (24 kB)
Requirement already satisfied: six>=1.10 in /usr/lib/python3.8/site-packages (from js2py->g4f) (1.15.0)
Requirement already satisfied: backports.zoneinfo in /usr/lib/python3.8/site-packages (from tzlocal>=1.2->js2py->g4f) (0.2.1)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/lib/python3.8/site-packages (from requests->g4f) (4.0.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3.8/site-packages (from requests->g4f) (1.26.2)
Collecting requests
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
     |████████████████████████████████| 62 kB 8.3 MB/s
Requirement already satisfied: regex>=2022.1.18 in /usr/lib/python3.8/site-packages (from tiktoken->g4f) (2023.8.8)
Using legacy 'setup.py install' for pyjsparser, since package 'wheel' is not installed.
Using legacy 'setup.py install' for PyExecJS, since package 'wheel' is not installed.
Building wheels for collected packages: aiohttp, frozenlist, multidict, yarl, curl-cffi, lz4, pillow, pycryptodome, tiktoken
  Building wheel for aiohttp (PEP 517) ... done
  Created wheel for aiohttp: filename=aiohttp-3.8.6-cp38-cp38-linux_x86_64.whl size=1087643 sha256=e92083eea9a8f5adc4d83b9ad4a528ee50ce3017d9ce1a52d79726acad9d16f3
  Stored in directory: /root/.cache/pip/wheels/d5/cb/f4/a6ee33f7824faac3363f22c6996808ff86056dbc91da444b44
  Building wheel for frozenlist (PEP 517) ... done
  Created wheel for frozenlist: filename=frozenlist-1.4.0-cp38-cp38-linux_x86_64.whl size=219116 sha256=e33238ec5db001da06d95362bc66ea4aaeadc2a6c3f7e665a5677623ea922f2d
  Stored in directory: /root/.cache/pip/wheels/25/9c/7f/136af32baadd6827c143c6508144cd3ff89dd409f3b67889b3
  Building wheel for multidict (PEP 517) ... done
  Created wheel for multidict: filename=multidict-6.0.4-cp38-cp38-linux_x86_64.whl size=123878 sha256=8d4d23d2b43fe6482d24420a8698d53b5d12cf4dfab04bc2ead57647272f42f2
  Stored in directory: /root/.cache/pip/wheels/ad/57/f9/50d749c49e8dbc76a61c1b27b84cb479c07b5bbe02ebe49fe6
  Building wheel for yarl (PEP 517) ... done
  Created wheel for yarl: filename=yarl-1.9.2-cp38-cp38-linux_x86_64.whl size=268302 sha256=5ef9a25f0575002c390239e2258819effc133e14416ccee11b016bd0a7d4bebc
  Stored in directory: /root/.cache/pip/wheels/fe/eb/37/34d4bf3521cbab8e88b454d004d2c374c8ea5e33ff4ea9d723
  Building wheel for curl-cffi (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp3ulp16sd
       cwd: /tmp/pip-install-w3xk3i9z/curl-cffi_71d9984bc87846ea8da7cac1affd31bd
  Complete output (98 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-38
  creating build/lib.linux-x86_64-cpython-38/curl_cffi
  copying curl_cffi/__init__.py -> build/lib.linux-x86_64-cpython-38/curl_cffi
  copying curl_cffi/curl.py -> build/lib.linux-x86_64-cpython-38/curl_cffi
  copying curl_cffi/const.py -> build/lib.linux-x86_64-cpython-38/curl_cffi
  copying curl_cffi/build.py -> build/lib.linux-x86_64-cpython-38/curl_cffi
  copying curl_cffi/aio.py -> build/lib.linux-x86_64-cpython-38/curl_cffi
  creating build/lib.linux-x86_64-cpython-38/curl_cffi/requests
  copying curl_cffi/requests/__init__.py -> build/lib.linux-x86_64-cpython-38/curl_cffi/requests
  copying curl_cffi/requests/headers.py -> build/lib.linux-x86_64-cpython-38/curl_cffi/requests
  copying curl_cffi/requests/session.py -> build/lib.linux-x86_64-cpython-38/curl_cffi/requests
  copying curl_cffi/requests/cookies.py -> build/lib.linux-x86_64-cpython-38/curl_cffi/requests
  copying curl_cffi/requests/models.py -> build/lib.linux-x86_64-cpython-38/curl_cffi/requests
  copying curl_cffi/requests/errors.py -> build/lib.linux-x86_64-cpython-38/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'
  creating build/lib.linux-x86_64-cpython-38/curl_cffi/ffi
  copying curl_cffi/ffi/cdef.c -> build/lib.linux-x86_64-cpython-38/curl_cffi/ffi
  copying curl_cffi/ffi/shim.c -> build/lib.linux-x86_64-cpython-38/curl_cffi/ffi
  copying curl_cffi/ffi/shim.h -> build/lib.linux-x86_64-cpython-38/curl_cffi/ffi
  running build_ext
  generating cffi module 'build/temp.linux-x86_64-cpython-38/curl_cffi._wrapper.c'
  creating build/temp.linux-x86_64-cpython-38
  building 'curl_cffi._wrapper' extension
  creating build/temp.linux-x86_64-cpython-38/build
  creating build/temp.linux-x86_64-cpython-38/build/temp.linux-x86_64-cpython-38
  creating build/temp.linux-x86_64-cpython-38/curl_cffi
  creating build/temp.linux-x86_64-cpython-38/curl_cffi/ffi
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -Icurl_cffi/include -Icurl_cffi/ffi -I/usr/include/python3.8 -c build/temp.linux-x86_64-cpython-38/curl_cffi._wrapper.c -o build/temp.linux-x86_64-cpython-38/build/temp.linux-x86_64-cpython-38/curl_cffi._wrapper.o
  build/temp.linux-x86_64-cpython-38/curl_cffi._wrapper.c: In function '_cffi_d_curl_easy_impersonate':
  build/temp.linux-x86_64-cpython-38/curl_cffi._wrapper.c:888:10: warning: implicit declaration of function 'curl_easy_impersonate'; did you mean 'curl_easy_perform'? [-Wimplicit-function-declaration]
    888 |   return curl_easy_impersonate(x0, x1, x2);
        |          ^~~~~~~~~~~~~~~~~~~~~
        |          curl_easy_perform
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -Icurl_cffi/include -Icurl_cffi/ffi -I/usr/include/python3.8 -c curl_cffi/ffi/shim.c -o build/temp.linux-x86_64-cpython-38/curl_cffi/ffi/shim.o
  curl_cffi/ffi/shim.c: In function '_curl_easy_setopt':
  curl_cffi/ffi/shim.c:9:16: warning: unused variable 'opt_value' [-Wunused-variable]
      9 |     CURLoption opt_value = (CURLoption) option;
        |                ^~~~~~~~~
  gcc -shared -Wl,--as-needed -Wl,--as-needed build/temp.linux-x86_64-cpython-38/build/temp.linux-x86_64-cpython-38/curl_cffi._wrapper.o build/temp.linux-x86_64-cpython-38/curl_cffi/ffi/shim.o -L/usr/local/lib -L/usr/lib -lcurl-impersonate-chrome -o build/lib.linux-x86_64-cpython-38/curl_cffi/_wrapper.abi3.so
  /usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lcurl-impersonate-chrome
  collect2: error: ld returned 1 exit status
  /tmp/pip-build-env-me16mr8d/overlay/lib/python3.8/site-packages/setuptools/command/build_py.py:204: _Warning: Package 'curl_cffi.ffi' is absent from the `packages` configuration.
  !!

          ********************************************************************************
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'curl_cffi.ffi' as an importable package[^1],
          but it is absent from setuptools' `packages` configuration.

          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 `packages` configuration 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_namespace` or `find_packages(...)/find`,
          you can try to use `exclude_package_data`, or `include-package-data=False` in
          combination with a more fine grained `package-data` configuration.

          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 `.py` files.
                On the other hand, currently there is no concept of package data
                directory, all directories are treated like packages.
          ********************************************************************************

  !!
    check.warn(importable)
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for curl-cffi
  Building wheel for lz4 (PEP 517) ... done
  Created wheel for lz4: filename=lz4-4.3.2-cp38-cp38-linux_x86_64.whl size=1336483 sha256=a464a3fcb4732b29458c99704e09b28d1662e12620ee4c1f4efcf78a3bb487db
  Stored in directory: /root/.cache/pip/wheels/8e/3a/04/771e883be828a58c08923de41417ceba7c11736411843a7723
  Building wheel for pillow (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp5sczdkt6
       cwd: /tmp/pip-install-w3xk3i9z/pillow_46a86340c85748bdaf2834f9ed8455ec
  Complete output (199 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-38
  creating build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/__init__.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/_version.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/features.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/TarIO.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/__main__.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/Image.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/_util.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/FitsImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/QoiImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/_deprecate.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/FontFile.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/_binary.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-cpython-38/PIL
  running egg_info
  writing src/Pillow.egg-info/PKG-INFO
  writing dependency_links to src/Pillow.egg-info/dependency_links.txt
  writing requirements to src/Pillow.egg-info/requires.txt
  writing top-level names to src/Pillow.egg-info/top_level.txt
  reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.c'
  warning: no files found matching '*.h'
  warning: no files found matching '*.sh'
  warning: no files found matching '*.txt'
  warning: no previously-included files found matching '.appveyor.yml'
  warning: no previously-included files found matching '.clang-format'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching '.editorconfig'
  warning: no previously-included files found matching '.readthedocs.yml'
  warning: no previously-included files found matching 'codecov.yml'
  warning: no previously-included files found matching 'renovate.json'
  warning: no previously-included files matching '.git*' found anywhere in distribution
  warning: no previously-included files matching '*.so' found anywhere in distribution
  no previously-included directories found matching '.ci'
  no previously-included directories found matching 'wheels'
  adding license file 'LICENSE'
  writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
  running build_ext

  The headers or library files could not be found for jpeg,
  a required dependency when compiling Pillow from source.

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html

  Traceback (most recent call last):
    File "<string>", line 988, in <module>
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-mjrncf0a/normal/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 364, in run
      self.run_command("build")
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 131, in run
      self.run_command(cmd_name)
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 88, in run
      _build_ext.run(self)
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
      self.build_extensions()
    File "<string>", line 811, in build_extensions
  __main__.RequiredDependencyException: jpeg

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 204, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/tmp/pip-install-w3xk3i9z/pillow_46a86340c85748bdaf2834f9ed8455ec/_custom_build/backend.py", line 53, in build_wheel
      return super().build_wheel(wheel_directory, config_settings, metadata_directory)
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 434, in build_wheel
      return self._build_with_temp_dir(
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 419, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-install-w3xk3i9z/pillow_46a86340c85748bdaf2834f9ed8455ec/_custom_build/backend.py", line 47, in run_setup
      return super().run_setup(setup_script)
    File "/tmp/pip-build-env-mjrncf0a/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 341, in run_setup
      exec(code, locals())
    File "<string>", line 1005, in <module>
  __main__.RequiredDependencyException:

  The headers or library files could not be found for jpeg,
  a required dependency when compiling Pillow from source.

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html

  ----------------------------------------
  ERROR: Failed building wheel for pillow
  Building wheel for pycryptodome (PEP 517) ... done
  Created wheel for pycryptodome: filename=pycryptodome-3.19.0-cp35-abi3-linux_x86_64.whl size=2235749 sha256=a7d397ce8a2771174a3a2a9d625619a3f702d2e8ad4158787f3ddf9688c85903
  Stored in directory: /root/.cache/pip/wheels/b3/8d/2a/056bb318d5a87a6461871fbd59aa6400ec88a05fff1c29e5a4
  Building wheel for tiktoken (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpswlit_km
       cwd: /tmp/pip-install-w3xk3i9z/tiktoken_5cfc7b4817d54b61af77e3fb3d73a5d4
  Complete output (38 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-38
  creating build/lib.linux-x86_64-cpython-38/tiktoken
  copying tiktoken/__init__.py -> build/lib.linux-x86_64-cpython-38/tiktoken
  copying tiktoken/registry.py -> build/lib.linux-x86_64-cpython-38/tiktoken
  copying tiktoken/core.py -> build/lib.linux-x86_64-cpython-38/tiktoken
  copying tiktoken/load.py -> build/lib.linux-x86_64-cpython-38/tiktoken
  copying tiktoken/_educational.py -> build/lib.linux-x86_64-cpython-38/tiktoken
  copying tiktoken/model.py -> build/lib.linux-x86_64-cpython-38/tiktoken
  creating build/lib.linux-x86_64-cpython-38/tiktoken_ext
  copying tiktoken_ext/openai_public.py -> build/lib.linux-x86_64-cpython-38/tiktoken_ext
  running egg_info
  writing tiktoken.egg-info/PKG-INFO
  writing dependency_links to tiktoken.egg-info/dependency_links.txt
  writing requirements to tiktoken.egg-info/requires.txt
  writing top-level names to tiktoken.egg-info/top_level.txt
  reading manifest file 'tiktoken.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching 'Makefile'
  adding license file 'LICENSE'
  writing manifest file 'tiktoken.egg-info/SOURCES.txt'
  copying tiktoken/py.typed -> build/lib.linux-x86_64-cpython-38/tiktoken
  running build_ext
  running build_rust
  error: can't find Rust compiler

  If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

  To update pip, run:

      pip install --upgrade pip

  and then retry package installation.

  If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
  ----------------------------------------
  ERROR: Failed building wheel for tiktoken
Successfully built aiohttp frozenlist multidict yarl lz4 pycryptodome
Failed to build curl-cffi pillow tiktoken
ERROR: Could not build wheels for curl-cffi, pillow, tiktoken which use PEP 517 and cannot be installed directly

Environment

github-actions[bot] commented 1 year ago

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] commented 1 year ago

Closing due to inactivity.

toandaominh1997 commented 11 months ago

I see that the package curl_cffi>=0.5.10b4 conflicts with MacM1 (maybe a stable version of curl_cfffi works fine for me but g4f's requirements do not use the stable version). Please downgrade g4f to 0.1.8.7 and it will work fine.

pip install g4f==0.1.8.7
FENZIGO commented 9 months ago

apk add libcurl curl-dev and then pip install curl-cffi