Writing
Fixing Pynlpir Segmentation License Expiration
Resolving LicenseError when using Pynlpir installed via pip in Anaconda.
Using Pynlpir installed with pip install pynlpir in an Anaconda environment.
First use of Pynlpir, running:
import pynlpir
pynlpir.open()
str="MIMO技术已经广泛应用于LTE、WIFI等领域,理论上天线越多,频谱效率和传输可靠性就会越高。"
segments=pynlpir.segment(str)
for segment in segments:
print(segment[0]+'/t'+segment[1])
Suddenly throws:
pynlpir.LicenseError: Your license appears to have expired. Try running "pynlpir update".
Fix:
- Go to the install directory
D:\Anaconda\exe\Lib\site-packages\pynlpir\Data
Find install path: pip show pynlpir
- Find the
NLPIR.userfile
Download the latest NLPIR.user and replace the old one
If you used pip but don’t know the package location, run pip show pynlpir in cmd—the system shows the installed path. Mine was ./anaconda3/lib/python3.6/site-packages/pynlpir/Data.
- Run
pynlpir update— License updated.