How to use: Added by @n-y-kim
‼️DO NOT DOWNLOAD OR CLONE THIS REPO! THIS IS READ ONLY FOR PYTHON USERS‼️
- Download the most recent release version from liblouis repo.(zip file)
- Check your environment.
import louis
is not supportable at arm64
architecture(v 3.21.0). Only x86_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:
``` python
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
inside from ctypes import ~
- Fix line 61:
``` python
import os
path_f = os.path.abspath( os.path.join(os.path.dirname(__file__), "liblouis.so.20"))
liblouis = CDLL(path_f)
```
- RUN
python setup.py install
again
- Go to
/usr/local/lib
(your library file) and check if liblouis.so.20
and liblouis.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 used cp
commands to copy.
``` shell
cp -a liblouis* /home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/louis/
```
- Now it should work! :)