PyEasyArchive icon indicating copy to clipboard operation
PyEasyArchive copied to clipboard

installation fails on fresh 21.10 w/ "liblibarchive.so not found", both pip-repo as well as git+https from here

Open toasta opened this issue 4 years ago • 5 comments

Hi,

installing on ubuntu 21.10 fails with some weird doubled "liblibarchive.so" error. Happens both for the version from pip as well as directly from github:

    ERROR: Command errored out with exit status 1:
     command: /home/bf/eth/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-acvpa_1f/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-acvpa_1f/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ud_9jj8l/install-record.txt --single-version-externally-managed --compile --install-headers /home/bf/eth/venv/include/site/python3.9/libarchive
         cwd: /tmp/pip-req-build-acvpa_1f/
    Complete output (4 lines):
    running install
    Verifying that the library is accessible.
    Library can not be loaded: [Errno 2] No such file or directory: b'liblibarchive.a'
    error: [Errno 2] No such file or directory: b'liblibarchive.a'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/bf/eth/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-acvpa_1f/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-acvpa_1f/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ud_9jj8l/install-record.txt --single-version-externally-managed --compile --install-headers /home/bf/eth/venv/include/site/python3.9/libarchive Check the logs for full command output.

(note the double "lib" in "liblibarchive". libarchive.so is installed:

 find / -xdev 2> /dev/null | grep -i libarchive.so
/usr/lib/x86_64-linux-gnu/libarchive.so.13
/usr/lib/x86_64-linux-gnu/libarchive.so.13.4.3
/usr/lib/x86_64-linux-gnu/libarchive.so

toasta avatar Nov 15 '21 07:11 toasta

libarchive/library.py defines

_LIBRARY_NAME = 'libarchive'
_LIBRARY_FILENAME = 'libarchive.so'

then does filepath = ctypes.util.find_library(_LIBRARY_NAME)

if i do that, i get:

>>> import ctypes.util
>>> ctypes.util.find_library('libarchive.so')
>>> ctypes.util.find_library('archive.so')
'libarchive.so.13'

toasta avatar Nov 15 '21 07:11 toasta

if i change that:

$ git diff
diff --git a/libarchive/library.py b/libarchive/library.py
index eaa8812..cf8cd31 100644
--- a/libarchive/library.py
+++ b/libarchive/library.py
@@ -6,7 +6,7 @@ import ctypes.util

 _LOGGER = logging.getLogger(__name__)

-_LIBRARY_NAME = 'libarchive'
+_LIBRARY_NAME = 'archive'
 _LIBRARY_FILENAME = 'libarchive.so'

 def find_and_load_library():

installation succeeds, is this 2104 specific?

toasta avatar Nov 15 '21 07:11 toasta

Python 3.9.7 (default, Sep 10 2021, 14:59:43)
[GCC 11.2.0] on linux
>>> ctypes.__version__
'1.1.0'

i case that's important.

toasta avatar Nov 15 '21 08:11 toasta

any update on this issue?

xoolive avatar Sep 15 '22 08:09 xoolive

Solution from Stackoverflow -

The file was probably renamed. Creating a symbolic link to the renamed file fixed the issue:

cd /usr/lib/x86_64-linux-gnu/
ln -s -f libarchive.a liblibarchive.a

https://stackoverflow.com/a/68910024

bityob avatar Mar 09 '23 14:03 bityob