Closed kakakhan2016 closed 7 years ago
I cannot reproduce your problem. Make sure you're installing the reshaper correctly, you can install it using pip pip install git+https://github.com/mpcabd/python-arabic-reshaper
Running Python 3.6.0:
(test_3) test_3 % pip install git+https://github.com/mpcabd/python-arabic-reshaper
Collecting git+https://github.com/mpcabd/python-arabic-reshaper
Cloning https://github.com/mpcabd/python-arabic-reshaper to /private/var/folders/wd/wh_b1h096f12bc2x4xfrfz340000gn/T/pip-3r_5334i-build
Installing collected packages: arabic-reshaper
Running setup.py install for arabic-reshaper ... done
Successfully installed arabic-reshaper-1.0.1
(test_3) test_3 % python
Python 3.6.0 (default, Dec 24 2016, 08:01:42)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import arabic_reshaper
>>> arabic_reshaper.reshape('مرحبا')
'ﻣﺮﺣﺒﺎ'
Running Python 2.7.13:
(test_2) test_2 % pip install git+https://github.com/mpcabd/python-arabic-reshaper
Collecting git+https://github.com/mpcabd/python-arabic-reshaper
Cloning https://github.com/mpcabd/python-arabic-reshaper to /private/var/folders/wd/wh_b1h096f12bc2x4xfrfz340000gn/T/pip-1ymtRf-build
Installing collected packages: arabic-reshaper
Running setup.py install for arabic-reshaper ... done
Successfully installed arabic-reshaper-1.0.1
(test_2) test_2 % python
Python 2.7.13 (default, Dec 18 2016, 07:03:39)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import arabic_reshaper
>>> arabic_reshaper.reshape(u'مرحبا')
u'\ufee3\ufeae\ufea3\ufe92\ufe8e'
>>>
Thanks for great package. I am using python 32 with windows 7 and successfully installed arabic-reshaper using python setup.py install command but fail to import it. Using import arabic-reshaper in my code shows syntax error while using import arabic_reshaper showing error module not found. pip freeze showing package install with name arabic_reshaper. Note that how python convert dash into underscore For workaround I have replace all occurrence of arabic-reshaper with arabicreshaper in .py file and compile again. Now import arabicreshaper import work. I search net about using dash in python package name and found that many people are facing problem.
Do you have solution for import arabic-reshaper error?