在Ubuntu上安装gensim时获取UnicodeDecodeError

时间:2015-07-13 13:38:53

标签: ubuntu pip gensim

我正在尝试使用以下方法在Ubuntu上安装gensim lib。

pip install --upgrade gensim

但是,我收到了这样的错误:

Requirement already up-to-date: gensim in /usr/local/lib/python3.4/dist-packages/gensim-0.12.0-py3.4-linux-x86_64.egg
Collecting numpy>=1.3 (from gensim)
Downloading numpy-1.9.2.tar.gz (4.0MB)
100% |################################| 4.0MB 146kB/s 
Collecting scipy>=0.7.0 (from gensim)
Downloading scipy-0.15.1.tar.gz (11.4MB)
100% |################################| 11.4MB 55kB/s
Requirement already up-to-date: six>=1.2.0 in /usr/lib/python3/dist-packages (from gensim)
Collecting smart-open>=1.2.1 (from gensim)
Downloading smart_open-1.2.1.tar.gz
Complete output from command python setup.py egg_info:
File "/tmp/pip-build-_nbem_oq/smart-open/setup.py", line 28, in <module>
    long_description = read('README.rst'),
  File "/tmp/pip-build-_nbem_oq/smart-open/setup.py", line 21, in read
    return open(os.path.join(os.path.dirname(__file__), fname)).read()
  File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 4344: ordinal not in range(128)
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_nbem_oq/smart-open

有谁知道如何修复它?

1 个答案:

答案 0 :(得分:1)

事实证明,我可以通过下载并解压缩gensim的tar.gz源来手动安装gensim lib,然后运行:

python setup.py install