pynlpir更新授权、报错NLPIR function ‘NLPIR_Init‘ failed/Your license appears to have expired.

这篇博客介绍两个问题:

  1. pynlpir 授权到期,运行时报错 NLPIR function 'NLPIR_Init' failedYour license appears to have expired. Try running "pynlpir update".
  2. 如何把授权文件下载到Linux服务器上 pynlpir 对应的Data文件夹下。

1. pynlpir 授权到期、更新授权。

  • 上面两种报错都是因为授权到期,我也运行过 pynlpir update 尝试自动更新授权,但是完全没用,还是得手动去Github上下载授权文件,然后用新的授权文件覆盖旧的授权文件
  • 解决方法:到 Github下载NLPIR.user 文件到本地,然后找到 pynlpir 的授权文件位置(你的python解释器所在位置的bin目录/lib/python3.X/site-packages/pynlpir/Data/NLPIR.user
    ),用下载的授权文件直接替换旧的授权文件,最后重启kernel或直接运行py文件就可以了。

2. 如何更新Linux服务器上的pynlpir授权文件

  • 上面的方法适用于本地环境下更新 pynlpir 的授权文件,但是对于Linux服务器,需要将授权文件上传到服务器的 pynlpir 的授权文件位置,或者直接从Github 上下载授权文件到 pynlpir 的授权文件位置。这里介绍第二种方法(更简单直接)。
  • Linux服务器下载网络文件用的是wget命令,形如:wget url(你要下载的文件的地址)
  • 解决方法:在 Github获取NLPIR.user的下载地址,复制地址,然后定位到 pynlpir 的授权文件位置,执行:
wget https://github.com/NLPIR-team/NLPIR/blob/master/License/license%20for%20a%20month/NLPIR-ICTCLAS%E5%88%86%E8%AF%8D%E7%B3%BB%E7%BB%9F%E6%8E%88%E6%9D%83/NLPIR.user

https...NPLIR.user 的下载地址。之后重启kernel或直接运行py文件就可以了。


更新:2024.02.29

今天发现 pynlpir 的授权文件又到期了,遂使用第二个方法的 wget 方式从 Github 上下载最新的授权文件。
但是,奇怪的是,在下载完授权文件、运行 pynlpir 时(import正常运行,但 pynlpir.open() 运行出错),jupyter notebook 的 kernel 直接就开始 restrating,一运行就 restrating,报 The kernel for XXX.ipynbappears to have died.lt will restart automatically. ,让人一头雾水,在网上到处找解决方案也是无果。

后来,心血来潮,直接打开 linux 下载的 license 文件,也就是 NLPIR.user,发现下载下来得到的是这么一串字符串:

{"payload":{"allShortcutsEnabled":false,"fileTree":{"License/license for a month/NLPIR-ICTCLAS分词系统授权":{"items":[{"name":"NLPIR.user","path":"License/license for a month/NLPIR-ICTCLAS分词系统授权/NLPIR.user","contentType":"file"}],"totalCount":1},"License/license for a month":{"items":[{"name":"Compare授权","path":"License/license for a month/Compare授权","contentType":"directory"},{"name":"DocExtractor文档提取授权","path":"License/license for a month/DocExtractor文档提取授权","contentType":"directory"},{"name":"Forward转发器","path":"License/license for a month/Forward转发器","contentType":"directory"},{"name":"HtmlParser网页正文提取授权","path":"License/license for a month/HtmlParser网页正文提取授权","contentType":"directory"},{"name":"JZSearch精准搜索引擎授权","path":"License/license for a month/JZSearch精准搜索引擎授权","contentType":"directory"},{"name":"KGB","path":"License/license for a month/KGB","contentType":"directory"},{"name":"KeyExtract关键词提取授权","path":"License/license for a month/KeyExtract关键词提取授权","contentType":"directory"},{"name":"KeyScanner九眼智能扫描授权","path":"License/license for a month/KeyScanner九眼智能扫描授权","contentType":"directory"},{"name":"LJSpider精准采集器","path":"License/license for a month/LJSpider精准采集器","contentType":"directory"},{"name":"LocationIdentify地域识别","path":"License/license for a month/LocationIdentify地域识别","contentType":"directory"},{"name":"NERICS","path":"License/license for a month/NERICS","contentType":"directory"},{"name":"NLPIR-ICTCLAS分词系统授权","path":"License/license for a month/NLPIR-ICTCLAS分词系统授权","contentType":"directory"},{"name":"NLPIR-Parser平台授权","path":"License/license for a month/NLPIR-Parser平台授权","contentType":"directory"},{"name":"NewWordFinder新词发现授权","path":"License/license for a month/NewWordFinder新词发现授权","contentType":"directory"},{"name":"PrivacyEraser脱敏工具","path":"License/license for a month/PrivacyEraser脱敏工具","contentType":"directory"},{"name":"RedupRemover去重授权","path":"License/license for a month/RedupRemover去重授权","contentType":"directory"},{"name":"Repeat110重复报警","path":"License/license for a month/Repeat110重复报警","contentType":"directory"},{"name":"SentimentAnalysis情绪分析","path":"License/license for a month/SentimentAnalysis情绪分析","contentType":"directory"},{"name":"SentimentNew情感分析授权","path":"License/license for a month/SentimentNew情感分析授权","contentType":"directory"},{"name":"SpellCheck拼写检查授权","path":"License/license for a month/SpellCheck拼写检查授权","contentType":"directory"},{"name":"SplitSentence分句系统","path":"License/license for a month/SplitSentence分句系统","contentType":"directory"},{"name":"Summary自动摘要提取授权","path":"License/license for a month/Summary自动摘要提取授权","contentType":"directory"},{"name":"TextSimilarity文本相似度","path":"License/license for a month/TextSimilarity文本相似度","contentType":"directory"},{"name":"TxtExtractor文档抽取器","path":"License/license for a month/TxtExtractor文档抽取器","contentType":"directory"},{"name":"classifier深度学习分类授权","path":"License/license for a month/classifier深度学习分类授权","contentType":"directory"},{"name":"classifier规则分类授权","path":"License/license for a month/classifier规则分类授权","contentType":"directory"},{"name":"cluster聚类授权","path":"License/license for a month/cluster聚类授权","contentType":"directory"},{"name":"docParser文档解析器","path":"License/license for a month/docParser文档解析器","contentType":"directory"},{"name":"iEncoder智能编码识别转换器","path":"License/license for a month/iEncoder智能编码识别转换器","contentType":"directory"},{"name":"word2vec授权","path":"License/license for a month/word2vec授权","contentType":"directory"},{"name":"LicenseUpdate.bat","path":"License/license for a month/LicenseUpdate.bat","contentType":"file"}],"totalCount":31},"License":{"items":[{"name":"license for a month","path":"License/license for a month","contentType":"directory"},{"name":"readme.md","path":"License/readme.md","contentType":"file"}],"totalCount":2},"":{"items":[{"name":"License","path":"License","contentType":"directory"},{"name":"LicenseClient","path":"LicenseClient","contentType":"directory"},{"name":"NLPIR SDK","path":"NLPIR SDK","contentType":"directory"},{"name":"NLPIR-ICTCLAS-Lucene","path":"NLPIR-ICTCLAS-Lucene","contentType":"directory"},{"name":"NLPIR-Parser","path":"NLPIR-Parser","contentType":"directory"},{"name":"paper","path":"paper","contentType":"directory"},{"name":"protege-CN","path":"protege-CN","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"NLPIR下载说明【SVN方法下载与网站直接下载】.pdf","path":"NLPIR下载说明【SVN方法下载与网站直接下载】.pdf","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"TortoiseSVN下载说明.pdf","path":"TortoiseSVN下载说明.pdf","contentType":"file"}],"totalCount":11}},"fileTreeProcessingTime":7.745569,"foldersToFetch":[],"repo":{"id":35019208,"defaultBranch":"master","name":"NLPIR","ownerLogin":"NLPIR-team","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2015-05-04T06:55:52.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/12182603?v=4","public":true,"private":false,"isOrgOwned":true},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1519967338.0","canEdit":false,"refType":"branch","currentOid":"dbead2c41f04697a396ad5bbba3012948ce05417"},"path":"License/license for a month/NLPIR-ICTCLAS分词系统授权/NLPIR.user","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/NLPIR-team/NLPIR/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"NLPIR.user","displayUrl":"https://github.com/NLPIR-team/NLPIR/blob/master/License/license%20for%20a%20month/NLPIR-ICTCLAS%E5%88%86%E8%AF%8D%E7%B3%BB%E7%BB%9F%E6%8E%88%E6%9D%83/NLPIR.user?raw=true","headerInfo":{"blobSize":"3.28 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","deleteInfo":{"deleteTooltip":"You must be signed in to make or propose changes"},"editInfo":{"editTooltip":"You must be signed in to make or propose changes"},"ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"gitLfsPath":null,"onBranch":true,"shortPath":"ae92c14","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2FNLPIR-team%2FNLPIR%2Fblob%2Fmaster%2FLicense%2Flicense%2520for%2520a%2520month%2FNLPIR-ICTCLAS%25E5%2588%2586%25E8%25AF%258D%25E7%25B3%25BB%25E7%25BB%259F%25E6%258E%2588%25E6%259D%2583%2FNLPIR.user","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":null,"truncatedSloc":null},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplateHelpUrl":"https://docs.github.com/articles/about-issue-and-pull-request-templates","issueTemplate":null,"discussionTemplate":null,"language":null,"languageID":null,"large":false,"loggedIn":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/NLPIR-team/NLPIR/blob/master/License/license%20for%20a%20month/NLPIR-ICTCLAS%E5%88%86%E8%AF%8D%E7%B3%BB%E7%BB%9F%E6%8E%88%E6%9D%83/NLPIR.user","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/NLPIR-team/NLPIR/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/NLPIR-team/NLPIR/raw/master/License/license%20for%20a%20month/NLPIR-ICTCLAS%E5%88%86%E8%AF%8D%E7%B3%BB%E7%BB%9F%E6%8E%88%E6%9D%83/NLPIR.user","renderImageOrRaw":true,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"repoOwner":"NLPIR-team","repoName":"NLPIR","showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":false,"workflowRedirectUrl":null,"symbols":null},"copilotInfo":null,"copilotAccessAllowed":false,"csrf_tokens":{"/NLPIR-team/NLPIR/branches":{"post":"66krTXyGksv4ypjw166F1Vvll_Tu3bi16Lbdc5GzVMXOZjPOrRhI9xOwTxr4B6dXhK-HI5yd0sDvgcGkEBPElA"},"/repos/preferences":{"post":"dVpC-wLa33CSB147fsjMwZfHCff6082__WlkO4Af07iEJjg0OO2ucBBwCi_981_hAZvfY0-pxUn_QcsUhy8Dsg"}}},"title":"NLPIR/License/license for a month/NLPIR-ICTCLAS分词系统授权/NLPIR.user at master · NLPIR-team/NLPIR"}

这玩意一看就不是个正经的授权文件,整的像个广告,属实是逆天!!!!

然后我手动从 Github 上面下载了 NLPIR.user,打开发现是一串乱码,这才是正常的授权文件该有的样子😡。
也不知道维护人员是咋整的,命令下载得到的是一个,手动下载的又是一个,属实是恶心到我了。

最后还是采用手动下载然后上传到 linux 服务器的方式把新的授权文件给配置上了,然后运行,OK。


原创不易,麻烦大家点个关注收藏评论支持一下~~

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值