Python Forum
Problem Using Python Library
Thread Rating:
  • 3 Vote(s) - 2.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem Using Python Library
#1
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
Reply
#2
Without showing the output of the error, we cannot help.
Further we should know: Windows or Linux  or ...
Reply
#3
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
Reply
#4
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()
Reply
#5
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
?
Reply
#6
(Nov-13-2017, 12:32 PM)j.crater Wrote: 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()

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
also on error, please post error messages verbatim.
did you use:
python setup.py install
?

Recheck the 3rd comment in this Thread.
Reply
#7
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?
Reply
#8
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) ]
Reply
#9
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-Par...nvironment.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  cinemagoer library problem lunacy90 21 2,234 Sep-08-2023, 04:30 PM
Last Post: menator01
  Problem with importing python-telegram library into the project gandonio 1 1,516 Nov-01-2022, 02:19 AM
Last Post: deanhystad
  Problem with using Crypto library reks2004 2 2,376 Mar-27-2020, 05:38 AM
Last Post: buran
  Problem installing library thunderspeed 2 2,280 Mar-22-2020, 11:04 PM
Last Post: thunderspeed
  Problem importing resource library ChrisM 8 3,866 Oct-23-2019, 01:40 PM
Last Post: ChrisM
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,745 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020