最近项目需求,要用到libsvm
,但是安装一直失败,后来改了了系统编码OK了。。
1、 安装方法:
pip install libsvm
2、 安装失败:
Looking in indexes: http://mirrors.jd.com/pypi/simple
Collecting libsvm==3.23.0
Downloading http://mirrors.jd.com/pypi/packages/ff/01/5506c690789f1d76105815d826f213ce724960851be45799d7023ed1aee7/libsvm-3.23.0.tar.gz
ERROR: Command errored out with exit status 1:
command: /usr/local/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gn88vgyg/libsvm/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gn88vgyg/libsvm/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-gn88vgyg/libsvm/pip-egg-info
cwd: /tmp/pip-install-gn88vgyg/libsvm/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-gn88vgyg/libsvm/setup.py", line 17, in <module>
LONG_DESCRIPTION = readme.read()
File "/usr/local/anaconda3/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2235: ordinal not in range(128)
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
3、 解决办法:
vim ~/.bashrc
export LANG="en_US.UTF-8"
source ~/.bashrc
4、 问题解决
声明: 总结学习,有问题或不当之处,可以批评指正哦,谢谢。