Problem Using Python Library - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Problem Using Python Library (/thread-6267.html) |
Problem Using Python Library - abir99 - Nov-13-2017 Hello , I am new on Python. I am trying to use a library called "bangla_pos_tagger"(1). Rules to use it: Install the module
python setup.py install Code import bangla_pos_tagger btagger=bangla_pos_tagger.BanglaTagger() #Query is an array of Bangla words btagger.pos_tag(query) #term is a single Bengali Term btagger.get_tag(term) where query is a tokenized words for a given Bangla Sentence. But it showing error on my terminal. I need instant help. (1) https://github.com/abhishekgupta92/bangla_pos_tagger RE: Problem Using Python Library - heiner55 - Nov-13-2017 Without showing the output of the error, we cannot help. Further we should know: Windows or Linux or ... RE: Problem Using Python Library - abir99 - Nov-13-2017 sudo python setup.py install [sudo] password for bdbot: running install running build running build_py running install_lib copying build/lib.linux-x86_64-2.7/bangla_pos_tagger.py -> /usr/local/lib/python2.7/dist-packages byte-compiling /usr/local/lib/python2.7/dist-packages/bangla_pos_tagger.py to bangla_pos_tagger.pyc running install_data creating /usr/local/config copying params.py -> /usr/local/config running install_egg_info Writing /usr/local/lib/python2.7/dist-packages/Bangla_POS_Tagger-1.0.egg-info ----------------------------------------------------------------------------- Now code: import bangla_pos_tagger btagger=bangla_pos_tagger.BanglaTagger() queary= "আমার নাম খান" btagger.pos_tag(query) ------------------------------ output: python a.py File "a.py", line 1 import bangla_pos_tagger btagger=bangla_pos_tagger.BanglaTagger() ^ SyntaxError: invalid syntax RE: Problem Using Python Library - j.crater - Nov-13-2017 The Python interpreter raises an error at this particular code: import bangla_pos_tagger btagger=bangla_pos_tagger.BanglaTagger()Are you sure about the assignment? I would say these are two lines: import bangla_pos_tagger btagger=bangla_pos_tagger.BanglaTagger() RE: Problem Using Python Library - Larz60+ - Nov-13-2017 how did you attempt instalation, step by tiny (need every step) step also on error, please post error messages verbatim. did you use: python setup.py install? RE: Problem Using Python Library - abir99 - Nov-14-2017 (Nov-13-2017, 12:32 PM)j.crater Wrote: The Python interpreter raises an error at this particular code: I am following guidelines from here: https://github.com/abhishekgupta92/bangla_pos_tagger (Nov-13-2017, 12:35 PM)Larz60+ Wrote: how did you attempt instalation, step by tiny (need every step) step Recheck the 3rd comment in this Thread. RE: Problem Using Python Library - j.crater - Nov-14-2017 I did not install the module and run the code. But that problematic line could simply be a bad copy-paste from code editor (not preserving newline). Have you tried separating that particular line into two? RE: Problem Using Python Library - abir99 - Nov-21-2017 After using import nltk Now it's showing that no module named nltk So I tried, sudo pip install -U nltk from here: http://www.nltk.org/install.html Result: sudo: pip: command not found [Python 2.7.12 (default, Jul 1 2016, 15:12:24) ] RE: Problem Using Python Library - sparkz_alot - Nov-21-2017 It's telling you 'pip' is not installed, at least for the 2.7 version. If you are on Linux, you probably have Python 3.x already installed. You could try sudo pip3 -V to see if pip is installed for the v3.x. If you get the same result, then you need to install pip, see the Basic Install here: https://python-forum.io/Thread-Basic-Part-1-Linux-Python-3-environment.
|