- Download the most recent release version from liblouis repo.(zip file)
- Check your environment.
import louis
is not supportable atarm64
architecture(v 3.21.0). Onlyx86_64
would be able to get the correct path. - Unzip your installed file.
- RUN
./configure
- RUN
make
- RUN
sudo make install
- Move to python folder and RUN
python setup.py install
- You would be able to
import louis
and test.
EXAMPLE:
import louis
print(louis.translateString(["braille-patterns.cti", "en-us-g2.ctb"], "Hello, World!"))
#⠠⠓⠑⠇⠇⠕⠂⠀⠠⠸⠺⠖
print(louis.backTranslateString(["braille-patterns.cti", "en-us-g2.ctb"], "⠓⠑⠇⠇⠕"))
#hello
If you have this problem(issue #990)(cython OSError), follow these steps:
(I got this error when I tried deploying web server, nginx & gunicorn on Ubuntu)
- Go to
~/python/louis/__init__.py
- Add function
CDLL
insidefrom ctypes import ~
- Fix line 61:
- RUN
python setup.py install
again - Go to
/usr/local/lib
(your library file) and check ifliblouis.so.20
andliblouis.a
exist - Copy those files to your python
louis
package folder. For example, my conda environments are:/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/louis/
. So I usedcp
commands to copy. - Now it should work! :)
import os
path_f = os.path.abspath( os.path.join(os.path.dirname(__file__), "liblouis.so.20"))
liblouis = CDLL(path_f)
cp -a liblouis* /home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/louis/