5

I am trying to install gensim using pip on my Virtual Machine. However, I get the error :

Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-jM6uSL-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/scipy
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 53: ordinal not in range(128)

I did look for similar issues on SO, and found `pip install pandas` gives UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 41: ordinal not in range(128) to be the closest one. However, I did try updating pip to the latest version.

The pip version details

pip 1.5.6 from /usr/local/lib/python2.7/dist-packages (python 2.7)

Any thoughts for this?

Community
  • 1
  • 1
Ashwini Khare
  • 1,645
  • 6
  • 20
  • 37

3 Answers3

1

I resolved it, turns out it was a memory issue. Here's a nice tutorial about swap memory that can be useful - https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

Ashwini Khare
  • 1,645
  • 6
  • 20
  • 37
1

I had the same problem, and find an answer here

just

export LC_ALL=C

solved my problem

Community
  • 1
  • 1
JasonWayne
  • 1,724
  • 1
  • 19
  • 16
  • If you are using ansible to install gensim, set the locale in `ansible.cfg`: use `module_lang = en_US.UTF-8` for instance ([documentation](http://docs.ansible.com/ansible/intro_configuration.html#module-lang)) – Paul Mougel May 09 '16 at 13:35
0

I had the same problem with my ubuntu 15.10. Finally, I solved it by downloading the package from pypi and install it manually by

python setup.py install

Then I successfully installed it and it worked well now.

ccy
  • 1,735
  • 16
  • 19