openzim / python-libzim

Libzim binding for Python: read/write ZIM files in Python
https://pypi.org/project/libzim/
GNU General Public License v3.0
62 stars 20 forks source link

Libzim for Termux app in android #77

Closed sobaee closed 4 years ago

sobaee commented 4 years ago

I can't install libzim in Termux app (aarch64) I already installed app prerequisites and dependencies. You may tell me whats the required versions of the dependecies, or how to install it manually from the source.

Please help!

kelson42 commented 4 years ago

@sobaee Can you please put here the whole commands an log you are running please?

sobaee commented 4 years ago

pip install libzim Collecting libzim Using cached libzim-0.0.3.post0.tar.gz (103 kB) Installing build dependencies ... error ERROR: Command errored out with exit status 1: command: /data/data/com.termux/files/usr/bin/python3 /data/data/com.termux/files/usr/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /data/data/com.termux/files/usr/tmp/pip-build-env-cdake3g2/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools >= 35.0.2' 'wheel >= 0.29.0' twine 'cython == 0.29.6' cwd: None Complete output (31 lines): Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/data/data/com.termux/files/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pip/main.py", line 26, in sys.exit(_main()) File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 73, in main command = create_command(cmd_name, isolated=("--isolated" in cmd_args)) File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pip/_internal/commands/init.py", line 104, in create_command module = importlib.import_module(module_path) File "/data/data/com.termux/files/usr/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 17, in from pip._internal.cli.req_command import RequirementCommand, with_cleanup File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 22, in from pip._internal.req.constructors import ( File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pip/_internal/req/init.py", line 10, in from .req_install import InstallRequirement File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 10, in import uuid File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/uuid.py", line 138 if not 0 <= time_low < 1<<32L: ^ SyntaxError: invalid syntax

ERROR: Command errored out with exit status 1: /data/data/com.termux/files/usr/bin/python3 /data/data/com.termux/files/usr/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /data/data/com.termux/files/usr/tmp/pip-build-env-cdake3g2/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools >= 35.0.2' 'wheel >= 0.29.0' twine 'cython == 0.29.6' Check the logs for full command output.

kelson42 commented 4 years ago

@sobaee I'm moving the ticket to the python binding which is the right place.

sobaee commented 4 years ago

@kelson42 Thanks

So, Do you have any suggestion about my question?

rgaudin commented 4 years ago

libzim binary is only distributed for linux-x64 and macOS-x64 and so is the bundled libzim provided in the python binding.

Please go to https://github.com/openzim/libzim and see if you can compile the library. Once this is done and installed, you'll have to install the python binding using the source

python3 setup.py build_ext -i
python3 setup.py install
sobaee commented 4 years ago

Thank you Termux Really, I can't thank you enough. It works perfectly.

apt install libzim pip install libzim

Or after: apt install libzim Type this: export LD_LIBRARY_PATH="${LIBZIM_DIR}/lib:$LD_LIBRARY_PATH"

Then: pip install libzim

Thanks