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

AttributeError: /usr/lib64/libmagic.so.1: undefined symbol: magic_list #8

Open
jingydz opened this issue Apr 23, 2024 · 1 comment
Open
Labels
installation-bug a bug with the installation process (build, requirements, dependencies, etc.)

Comments

@jingydz
Copy link

jingydz commented Apr 23, 2024

##Comman
git clone https://github.com/Kukuster/SumStatsRehab.git && cd SumStatsRehab
pip install -r requirements.txt
python3 setup.py build
python3 setup.py install
SumStatsRehab --help

##Bug
SumStatsRehab]$ SumStatsRehab --help
Traceback (most recent call last):
File "/xxx/software/miniconda3/bin/SumStatsRehab", line 33, in
sys.exit(load_entry_point('SumStatsRehab==1.2.1', 'console_scripts', 'SumStatsRehab')())
File "/xxx/software/miniconda3/bin/SumStatsRehab", line 25, in importlib_load_entry_point
return next(matches).load()
File "/xxx/software/miniconda3/lib/python3.9/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/xxx/software/miniconda3/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/xxx/software/miniconda3/lib/python3.9/site-packages/SumStatsRehab-1.2.1-py3.9.egg/SumStatsRehab.py", line 14, in
from lib.prepare_GWASSS_columns import prepare_GWASSS_columns
File "/xxx/software/miniconda3/lib/python3.9/site-packages/SumStatsRehab-1.2.1-py3.9.egg/lib/prepare_GWASSS_columns.py", line 10, in
from lib.file import resolve_bare_text_file
File "/xxx/software/miniconda3/lib/python3.9/site-packages/SumStatsRehab-1.2.1-py3.9.egg/lib/file.py", line 10, in
import magic
File "/xxx/software/miniconda3/lib/python3.9/site-packages/magic/init.py", line 452, in
_add_compat(globals())
File "/xxx/software/miniconda3/lib/python3.9/site-packages/magic/init.py", line 416, in _add_compat
from magic import compat
File "/xxx/software/miniconda3/lib/python3.9/site-packages/magic/compat.py", line 98, in
_list = _libraries['magic'].magic_list
File "/xxx/software/miniconda3/lib/python3.9/ctypes/init.py", line 395, in getattr
func = self.getitem(name)
File "/xxx/software/miniconda3/lib/python3.9/ctypes/init.py", line 400, in getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib64/libmagic.so.1: undefined symbol: magic_list

@Kukuster
Copy link
Owner

I reproduced the issue on fresh Ubuntu 20.04.1 Docker image, with miniconda 24.3.0, python 3.10.12.

We will have to make an update. But for now, I recommend the following steps to fix your issue:

1) Manually change the requirements for scipy version in both requirements.txt and setup.py files

from: scipy==1.6.1
to: scipy==1.10.1

2) Install system package libmagic and/or reinstall python package python-magic. Depending on your system [R], run:

Debian-based Linux

pip uninstall python-magic
apt install libmagic1 -y
pip install -r requirements.txt # will reinstall python-magic and scipy 

MacOS

pip uninstall python-magic
brew install libmagic
pip install -r requirements.txt # will reinstall python-magic and scipy 

Windows

pip uninstall python-magic
pip install -r requirements.txt # will reinstall python-magic and scipy 
pip install python-magic-bin

3) Reinstall SumStatsRehab:

python3 setup.py build
python3 setup.py install

After this SumStatsRehab --help should work.

scipy update will not affect the functionality: we rely only on normal distribution (scipy.stats.norm), and it was not changed between these versions according to the scipy release notes.

@Kukuster Kukuster added bug Something isn't working installation-bug a bug with the installation process (build, requirements, dependencies, etc.) and removed bug Something isn't working labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation-bug a bug with the installation process (build, requirements, dependencies, etc.)
Projects
None yet
Development

No branches or pull requests

2 participants