tsroten / pynlpir

A Python wrapper around the NLPIR/ICTCLAS Chinese segmentation software.
MIT License
566 stars 135 forks source link

NLPIR function 'NLPIR_Init' failed,icense is out #57

Closed stud20090001 closed 7 years ago

stud20090001 commented 8 years ago

import pynlpir pynlpir.open() RuntimeError: NLPIR function 'NLPIR_Init' failed.

err log: [2016-07-01 09:47:08] d:\Anaconda3\lib\site-packages\pynlpir\Data\NLPIR.user Not valid license or your license expired! Please feel free to contact pipy_zhang@msn.com!

LucaDemo commented 8 years ago

Same here, probably it's the same problem that there has been on Aug 1st 2015: https://github.com/tsroten/pynlpir/issues/31

RangoHU commented 8 years ago

Same here.

NickPoon commented 8 years ago

Same here. The problem seems can be solved as in #38

JingwenJessica commented 8 years ago

Same here. I update the user license file and everything works now.

Downloaded the latest NLPIR package(2016-06-07) and replaced the NLPIR.user file in the Data folder. This should solve the problem.

LucaDemo commented 8 years ago

Yep it works, thanks

haoran-zhang commented 8 years ago

They expire the license very often. You can check the date+'.err' file in Data, most of the reason is the license was expired. You can folk their github account, download and replace the license in Data at the first time. https://github.com/NLPIR-team/NLPIR/tree/master/License

tsroten commented 8 years ago

I've updated the license file in version 0.4.5 of PyNLPIR. You can download it from PyPI: https://pypi.python.org/pypi/PyNLPIR/

tsroten commented 8 years ago

Also, I've been working on a license auto-updater. I'd appreciate any help with testing it on Windows. For anyone who wants to help and knows how to run PyNLPIR from the develop branch, could you give it a shot? After it's installed, pynlpir update is the command that can be run to update the license.

tsroten commented 8 years ago

Okay, the license auto-updater has been successfully tested on Windows (and Linux and OS X). The notable downside is that NLPIR now packages their licenses in RAR archives, so any system that runs PyNLPIR's license downloader/updater will need to have some type of software that can extract RAR archives.

On OS X -- it's trivial:

brew install unrar

On Linux, it's also trivial (here is an example using apt):

sudo apt-get install p7zip-rar

On Windows, it's almost trivial:

Basically, PyNLPIR uses patool to extract the RAR archive. It supports the following executables: rar, unrar, and 7z.

tsroten commented 8 years ago

The trouble is, since February 2016, NLPIR has released the NLPIR-ICTCLAS license in three different formats.

First, in February it was the binary .user license file. Second, a week ago it was published as a ZIP archive. Third, six days ago it was changed to a RAR archive.

So, we don't have any assurances that an auto-updater will continue working. If this doesn't work, obtaining the license file might have to be made manual. And then, PyNLPIR will just have a convenience CLI to add the license to the appropriate directory.

tsroten commented 8 years ago

I've reached out to Dr. Zhang to see if he will consider standardizing the format he uploads the new license files in.

soledada commented 7 years ago

The problem occurs in the first day of 2017 So is there some error about the auto-updater ?

I replace the "NLPIR.user" on my computer with this file: https://github.com/NLPIR-team/NLPIR/blob/master/License/license%20for%20a%20month/NLPIR-ICTCLAS%E5%88%86%E8%AF%8D%E6%8E%88%E6%9D%83/NLPIR.user And it seems pynlpir works now.

tsroten commented 7 years ago

Ok, the license updater is in version 0.5: https://pypi.python.org/pypi/PyNLPIR

pynlpir update to install/update the license.

hanhan4321 commented 7 years ago

I use pynlpir update to update the license,it also has the the same error: pynlpir.LicenseError: Your license appears to have expired. Try running "pynlpir update". then I debug it ,find it in init.py

elif 'Can not open License file' in line: raise LicenseError('Your license appears to be ' 'missing. Try running "pynlpir ' 'update".')

I tried many times,I don't know the reason.

tsroten commented 7 years ago

Hi @hanhan4321! Can you please tell me what it says when you run pynlpir update from your terminal?

hanhan4321 commented 7 years ago

Today, it's ok. The NLPIR-team updates the April license today. Thank you!

getmr commented 6 years ago

In [12]: pynlpir.nlpir.ImportUserDict("/Users/zhangjintao/Desktop/随笔/中文分词比较/httpcws_dict.txt")

ArgumentError Traceback (most recent call last)

in () ----> 1 pynlpir.nlpir.ImportUserDict("/Users/zhangjintao/Desktop/随笔/中文分词比较/httpcws_dict.txt") ArgumentError: argument 1: : wrong type