2024-03-29 09:48:18 发布
网友
今天,当我安装bcrypt使用的烧瓶时:
pip install flask-bcrypt
发生此错误:
你可以试着跟着
export LANG=en_US.UTF-8 pip install flask-bcrypt
在命令下键入pythonshell时
>>> import sys >>> sys.getdefaultencoding()
它将输出:
所以,我修改
/etc/python2.7/sitecustomize.py
添加:
import sys sys.setdefaultencoding('utf-8')
现在,defaultencoding更改为:
'utf-8'
此错误已解决,但也有另一个错误:
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
你可以看到这个:when I try to install Flask-bcrypt it throws me error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
我只安装:
apt-get install libffi-dev
最后,我成功地安装了烧瓶bcrypt。在
你可以试着跟着
在命令下键入pythonshell时
它将输出:
^{pr2}$所以,我修改
添加:
现在,defaultencoding更改为:
此错误已解决,但也有另一个错误:
你可以看到这个:when I try to install Flask-bcrypt it throws me error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
我只安装:
最后,我成功地安装了烧瓶bcrypt。在
相关问题 更多 >
编程相关推荐