termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
35.83k stars 3.77k forks source link

[Bug]: ICU fix for pkg-config #3196

Closed mablue closed 1 week ago

mablue commented 1 year ago

Problem description

Collecting libretranslate
  Using cached libretranslate-1.3.8-py3-none-any.whl (403 kB)
Collecting argostranslate==1.7.5
  Using cached argostranslate-1.7.5-py3-none-any.whl (27 kB)
Collecting Flask==2.2.2
  Using cached Flask-2.2.2-py3-none-any.whl (101 kB)
Collecting flask-swagger==0.2.14
  Using cached flask-swagger-0.2.14.tar.gz (8.6 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting flask-swagger-ui==4.11.1
  Using cached flask_swagger_ui-4.11.1-py3-none-any.whl (1.4 MB)
Collecting Flask-Limiter==2.6.3
  Using cached Flask_Limiter-2.6.3-py3-none-any.whl (25 kB)
Collecting waitress==2.1.2
  Using cached waitress-2.1.2-py3-none-any.whl (57 kB)
Collecting expiringdict==1.2.2
  Using cached expiringdict-1.2.2-py3-none-any.whl (8.5 kB)
Collecting LTpycld2==0.42
  Using cached LTpycld2-0.42.tar.gz (41.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting morfessor==2.0.6
  Using cached Morfessor-2.0.6-py3-none-any.whl (35 kB)
Collecting appdirs==1.4.4
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting APScheduler==3.9.1
  Using cached APScheduler-3.9.1-py2.py3-none-any.whl (59 kB)
Collecting translatehtml==1.5.2
  Using cached translatehtml-1.5.2-py3-none-any.whl (3.3 kB)
Collecting argos-translate-files==1.1.0
  Using cached argos_translate_files-1.1.0-py3-none-any.whl (9.5 kB)
Collecting itsdangerous==2.1.2
  Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Collecting Werkzeug==2.2.2
  Using cached Werkzeug-2.2.2-py3-none-any.whl (232 kB)
Collecting requests==2.28.1
  Using cached requests-2.28.1-py3-none-any.whl (62 kB)
Collecting redis==4.3.4
  Using cached redis-4.3.4-py3-none-any.whl (246 kB)
Collecting prometheus-client==0.15.0
  Using cached prometheus_client-0.15.0-py3-none-any.whl (60 kB)
Collecting setuptools>=0.7
  Using cached setuptools-66.0.0-py3-none-any.whl (1.3 MB)
Collecting six>=1.4.0
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pytz
  Using cached pytz-2022.7.1-py2.py3-none-any.whl (499 kB)
Collecting tzlocal!=3.*,>=2.0
  Using cached tzlocal-4.2-py3-none-any.whl (19 kB)
Collecting beautifulsoup4>=4.9.3
  Using cached beautifulsoup4-4.11.1-py3-none-any.whl (128 kB)
Collecting lxml==4.8.0
  Using cached lxml-4.8.0.tar.gz (3.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
INFO: pip is looking at multiple versions of argos-translate-files to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of apscheduler to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of appdirs to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of libretranslate to determine which version is compatible with other requirements. This could take a while.
Collecting libretranslate
  Using cached libretranslate-1.3.7-py3-none-any.whl (403 kB)
Collecting argostranslate==1.7.0
  Using cached argostranslate-1.7.0-py3-none-any.whl (26 kB)
Collecting libretranslate
  Using cached libretranslate-1.3.6-py3-none-any.whl (402 kB)
  Using cached libretranslate-1.3.5-py3-none-any.whl (402 kB)
  Using cached libretranslate-1.3.4-py3-none-any.whl (401 kB)
  Using cached libretranslate-1.3.3-py3-none-any.whl (400 kB)
  Using cached libretranslate-1.3.2-py3-none-any.whl (399 kB)
Collecting pyicu>=2.8
  Using cached PyICU-2.10.2.tar.gz (255 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
  ╰─> [71 lines of output]
      Package icu-i18n was not found in the pkg-config search path.
      Perhaps you should add the directory containing `icu-i18n.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'icu-i18n' found
      Package icu-i18n was not found in the pkg-config search path.
      Perhaps you should add the directory containing `icu-i18n.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'icu-i18n' found

      Building PyICU 2.10.2 for ICU 0.29.2 (max ICU major version supported: 72)

      (running 'icu-config --cxxflags --cppflags')
      Could not configure CFLAGS with icu-config
      (running 'pkg-config --cflags icu-i18n')
      Could not configure CFLAGS with pkg-config
      (running 'icu-config --ldflags')
      Could not configure LFLAGS with icu-config
      (running 'pkg-config --libs icu-i18n')
      Could not configure LFLAGS with pkg-config
      Traceback (most recent call last):
        File "<string>", line 223, in <module>
        File "<string>", line 36, in configure_with_icu_config
        File "<string>", line 19, in check_output
        File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 466, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 548, in run
          with Popen(*popenargs, **kwargs) as process:
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 1024, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 1899, in _execute_child
          raise child_exception_type(errno_num, err_msg, err_filename)
      FileNotFoundError: [Errno 2] No such file or directory: 'icu-config'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "<string>", line 226, in <module>
        File "<string>", line 50, in configure_with_pkg_config
        File "<string>", line 19, in check_output
        File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 466, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 571, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '('pkg-config', '--libs', 'icu-i18n')' returned non-zero exit status 1.

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
          main()
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-iz6j0izy/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-iz6j0izy/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "/data/data/com.termux/files/usr/tmp/pip-build-env-iz6j0izy/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 233, in <module>
      RuntimeError:
      Please install pkg-config on your system or set the PYICU_LFLAGS environment
      variable to the flags required by the linker to find the libraries for ICU

      [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.

Steps to reproduce the behavior.

pip install libretranslate

What is the expected behavior?

Run withoue error

System information

2096779623 commented 1 year ago

pkg i libicu -y

mablue commented 1 year ago

thanks bro 🚶

mablue commented 1 year ago

another error during pyqt5 dependency installation AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

2096779623 commented 1 year ago

another error during pyqt5 dependency installation AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

Try:

pkg upgrade -y
pkg rem python python-pip pyqt5 -y
rm -rf ~/.pip/
pkg i python python-pip -y
pkg i pyqt5 -y
didi8517 commented 1 year ago

Hi there, I'm currently also trying to install libretranslate on Termux with Android 13, I ran amongst others also in above mentioned error and tried the solution given, but now I get another error with installing/running PyICU: Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [20 lines of output] (running 'icu-config --version')

  Building PyICU 2.11 for ICU 73.1 (max ICU major version supported: 73)

  (running 'icu-config --cxxflags --cppflags')
  Adding CFLAGS="-std=c++11 -I/data/data/com.termux/files/usr/include" from /data/data/com.termux/files/usr/bin/icu-config
  (running 'icu-config --ldflags')
  Adding LFLAGS="-L/data/data/com.termux/files/usr/lib -licui18n -licuuc -licudata" from /data/data/com.termux/files/usr/bin/icu-config
  running dist_info
  creating /data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info
  writing /data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info/PKG-INFO
  writing dependency_links to /data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info/dependency_links.txt
  writing top-level names to /data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info/top_level.txt
  writing manifest file '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info/SOURCES.txt'
  reading manifest file '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info/SOURCES.txt'
  creating '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU-2.11.dist-info'
  error: [('/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info/PKG-INFO', '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info.__bkp__/PKG-INFO', "[Errno 13] Permission denied: '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info.__bkp__/PKG-INFO'"), ('/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info/dependency_links.txt', '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info.__bkp__/dependency_links.txt', "[Errno 13] Permission denied: '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info.__bkp__/dependency_links.txt'"), ('/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info/top_level.txt', '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info.__bkp__/top_level.txt', "[Errno 13] Permission denied: '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info.__bkp__/top_level.txt'"), ('/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info/SOURCES.txt', '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info.__bkp__/SOURCES.txt', "[Errno 13] Permission denied: '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info.__bkp__/SOURCES.txt'"), ('/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info', '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info.__bkp__', "[Errno 13] Permission denied: '/data/data/com.termux/files/usr/tmp/pip-modern-metadata-z0fdc5mq/PyICU.egg-info.__bkp__'")]
  [end of output]

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

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

I get the same error when I run the pip install cmd for PyICU.

Any suggestions?

didi8517 commented 1 year ago

Ok. In the end the PyICU was resolved by just re installing python and trying again. Then I also ran into the pyqt5 problem, and pip couldn't find a way to install libretranslate with the version Termux gives (5.15.9), but wanted to install .4 - which I had to try to do manually, but after so many tries and errors and time wasted, I just gave up on it...