我需要为python2.7安装Gevent但在尝试几乎所有后我仍然没有安装它.
我有python 2.6.6,这里都工作正常...但我需要python2.7 +然后我安装python 2.7.9现在只有问题...在我的项目的某些部分工作在python 2.6之前确定,但现在我的项目没有运行2.6和2.7,不知道为什么它停止使用2.6但nvm我需要它与2.7但....我无法安装gevent,我已经安装了libevent-devel一个greenlet但我无法安装gevent
# pip2.7 install gevent
Collecting gevent
Using cached gevent-1.0.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): greenlet in /usr/local/lib/python2.7/site-packages (from gevent)
Installing collected packages: gevent
Running setup.py install for gevent
configure: error: in `/tmp/pip-build-fpnLvN/gevent/build/temp.linux-x86_64-2.7/libev':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Running '/bin/sh /tmp/pip-build-fpnLvN/gevent/libev/configure > configure-output.txt' in /tmp/pip-build-fpnLvN/gevent/build/temp.linux-x86_64-2.7/libev
building 'gevent.core' extension
ccache gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes …Run Code Online (Sandbox Code Playgroud) 同
print(" {:d}). {:s} ({:d})".format(i, account, num_char))
Run Code Online (Sandbox Code Playgroud)
我收到错误:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 4: ordinal not in range(128)
Run Code Online (Sandbox Code Playgroud)
但当我把它改为:
print " %d). %s (%d)" % (i, account, num_char)
Run Code Online (Sandbox Code Playgroud)
然后没有问题,输出与两个打印相同.
那么第一个表达式出了什么问题,为什么它在第二个表达式中有效呢?