When use pip to install flask-bcrypt, one error is :UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 49: ordinal not in range(128)
<p>Today, when I install flask-bcrypt used:</p>

<pre><code>pip install flask-bcrypt
</code></pre>

<p>This error happend:</p>

<pre><code>Command /home/sf/python/venv/bin/python2 -c "import setuptools, 
tokenize;__file__='/tmp/pip-build-duYRO6/bcrypt/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hlvpv8-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/sf/python/venv/include/site/python2.7 failed with error code 1 in /tmp/pip-build-duYRO6/bcrypt
Traceback (most recent call last):
  File "/home/sf/python/venv/bin/pip", line 11, in &lt;module&gt;
    sys.exit(main())
  File "/home/sf/python/venv/local/lib/python2.7/site-packages/pip/__init__.py", line 248, in main
    return command.main(cmd_args)
  File "/home/sf/python/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 49: ordinal not in range(128)
</code></pre>

<p>When you type under command to python shell,   </p>

<pre><code>&gt;&gt;&gt; import sys
&gt;&gt;&gt; sys.getdefaultencoding()
</code></pre>

<p>it will output this:</p>

<pre><code>'ascii'
</code></pre>

<p>So, I modify </p>

<pre><code>/etc/python2.7/sitecustomize.py
</code></pre>

<p>added:</p>

<pre><code>import sys
sys.setdefaultencoding('utf-8')
</code></pre>

<p>Now the defaultencoding change to the:</p>

<pre><code>'utf-8'
</code></pre>

<p>This error was solved, but also had another error:</p>

<pre><code>Command /home/sf/python/venv/bin/python2 -c "import setuptools,  
tokenize;__file__='/tmp/pip-build-6LgjpC/bcrypt/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', 
'\n'), __file__, 'exec'))" install --record /tmp/pip-3qxBJi-record/install-
record.txt --single-version-externally-managed --compile --install-headers 
/home/sf/python/venv/include/site/python2.7 failed with error code 1 in 
/tmp/pip-build-6LgjpC/bcrypt
Storing debug log for failure in /home/sf/.pip/pip.log
</code></pre>

<p>You can see this: <a href="http://stackoverflow.com/questions/28363514/when-i-try-to-install-flask-bcrypt-it-throws-me-error-command-x86-64-linux-gnu">when I try to install Flask-bcrypt it throws me error: command &#39;x86_64-linux-gnu-gcc&#39; failed with exit status 1</a></p>

<p>I just install:</p>

<pre><code>apt-get install libffi-dev
</code></pre>

<p>Finally, I succeed to install the flask-bcrypt.</p>

python python-2.7 pip