Skip to content
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

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

Open
toasta opened this issue Nov 15, 2021 · 5 comments

Comments

@toasta
Copy link

toasta commented Nov 15, 2021

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
Copy link
Author

toasta commented Nov 15, 2021

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
Copy link
Author

toasta commented Nov 15, 2021

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
Copy link
Author

toasta commented Nov 15, 2021

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.

@xoolive
Copy link

xoolive commented Sep 15, 2022

any update on this issue?

@bityob
Copy link

bityob commented Mar 9, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants