collab-uniba / pySenti4SD

Python implementation of Senti4SD
MIT License
12 stars 9 forks source link

[Mac OS X] LIBLINEAR library not found #8

Open louieQ opened 3 years ago

louieQ commented 3 years ago

After performing the setup steps described in README.md, I am not able to run the proposed example for polarity detection.

Context

Operating System: MacOS Big Sur (v11.2.3)

Process

The git lfs and java 8+ requirements were already satisfied on my machine. Therefore, I only had to perform the following steps to complete the setup:

  1. Install a Python 3.7 virtual environment
    python3.7 -m venv env
  2. Install the dependencies declared in requirements.txt
    pip install -r requirements.txt

Finally, I issued the example command:

sh classification.sh -i Sample.csv -d sc

Expected result

I expect to get a .csv file containing the sentiment predictions for the sentences in Sample.csv.

Current result

At first, the script appears to be running smoothly, producing the following output:

Loading DSM ...
mar 19, 2021 7:07:57 PM di.uniba.it.tdsm.vectors.MemoryVectorReader init
INFO: Loading vector store: /Users/luigiquaranta/Developer/collab/pySenti4SD/./java/dsm.bin
mar 19, 2021 7:08:08 PM di.uniba.it.tdsm.vectors.MemoryVectorReader init
INFO: Total vectors/dimension: 346.197/600
Vector dimension: 600
Terminato

Then, it raises the following exception:

Traceback (most recent call last):
  File "/Users/luigiquaranta/Developer/collab/pySenti4SD/python/core/liblinear_multicore/liblinear.py", line 30, in <module>
    liblinear = CDLL(path.join(dirname, 'so/liblinear.so.3'))
  File "/opt/anaconda3/lib/python3.7/ctypes/__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/luigiquaranta/Developer/collab/pySenti4SD/python/core/liblinear_multicore/so/liblinear.so.3, 6): no suitable image found.  Did find:
    /Users/luigiquaranta/Developer/collab/pySenti4SD/python/core/liblinear_multicore/so/liblinear.so.3: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
    /Users/luigiquaranta/Developer/collab/pySenti4SD/python/core/liblinear_multicore/so/liblinear.so.3: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./python/classification_task.py", line 11, in <module>
    from core.classification import Classification
  File "/Users/luigiquaranta/Developer/collab/pySenti4SD/python/core/classification.py", line 15, in <module>
    from liblinearutil import *
  File "/Users/luigiquaranta/Developer/collab/pySenti4SD/python/core/liblinearutil.py", line 6, in <module>
    from liblinear_multicore.liblinear import *
  File "/Users/luigiquaranta/Developer/collab/pySenti4SD/python/core/liblinear_multicore/liblinear.py", line 38, in <module>
    raise Exception('LIBLINEAR library not found.')
Exception: LIBLINEAR library not found.
himarange commented 2 years ago

Same.. did you manage to find a fix? I'm now trying to run it on my old windows :sad: