在Anaconda上安装SenticNet软件包会产生UnicodeDecodeError [英] Installing SenticNet package on Anaconda gives UnicodeDecodeError

查看:156
本文介绍了在Anaconda上安装SenticNet软件包会产生UnicodeDecodeError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用Conda安装SenticNet进行情感分析时,找不到它.然后我尝试了pip安装,但出现了错误:

When I try to install SenticNet for sentiment analysis using Conda it cannot find it. Then I tried pip install and I got the error:

Collecting senticnet   Using cached senticnet-0.3.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "C:\Users\A00220~1\AppData\Local\Temp\pip-build-ez4td4hb\senticnet\setup.py", line 20, in <module>
        license=open('LICENSE').read(),
      File "C:\Anaconda3\lib\encodings\cp1252.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position
181: character maps to <undefined>

我有Anaconda 64位,python 3.4.3和pip 7.0.3

I have Anaconda 64-bit, python 3.4.3 and pip 7.0.3

推荐答案

从以下位置克隆github存储库:

Clone the github repository from:

https://github.com/yurimalheiros/senticnetapi

解压缩文件后,打开setup.py并将第20行替换为:

After unzipping the file, open setup.py and replace line number 20 with:

license = open('LICENSE',encoding ='utf-8').read()

license=open('LICENSE', encoding='utf-8').read()

此后,请在此处打开命令提示符(确保已为python设置了环境变量)

after this, open command prompt here(make sure you have environment variable set for python)

运行命令->'python setup.py install'

run the command -> 'python setup.py install'

这将为python安装sendicnet,现在要使其在Anaconda中运行,请复制以下文件夹:

This will install senticnet for python, now to get it running in Anaconda, copy the following folder:

C:\ Users \ HP \ AppData \ Local \ Programs \ Python \ Python36-32 \ Lib \ site-packages \ senticnet-1.3-py3.6.egg \ senticnet

C:\Users\HP\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\senticnet-1.3-py3.6.egg\senticnet

收件人:

C:\ Users \ HP \ Anaconda4 \ Lib \ site-packages \ senticnet (根据您的配置,路径会有所不同)

C:\Users\HP\Anaconda4\Lib\site-packages\senticnet (the path will be different based upon your configurations)

这篇关于在Anaconda上安装SenticNet软件包会产生UnicodeDecodeError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆