win系统下为Python3.5安装flask-mongoengine 库

yipeiwu_com7年前Python基础

环境: windows 10、python 3.5、flask-mongoengine 0.8.2或0.9.0

使用以下命令安装 flask-mongoengine

pip install flask-mongoengine

会出现以下错误:

复制代码 代码如下:
flask-mongoengine-0.8.2\setup.py", line 10, in <module>
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 3978: illegal multibyte sequence

定为 setup.py 中的错误行:

doc_path = os.path.join(os.path.dirname(__file__), "docs", "index.rst")
long_description = open(doc_path).read()

是在读取 doc_path 文件时发生错误,此文件为 docs/index.rst,其为帮助说明文档。

粗暴一点,将其中的内容删除。github 上下载 flask-mongoengine 源码包。

运行如下命令安装:

python setup.py install

相关文章

python写xml文件的操作实例

本文实例讲述了python写xml文件的操作的方法,分享给大家供大家参考。具体方法如下: 要生成的xml文件格式如下: <?xml version="1.0" ?...

python读取一个目录下所有txt里面的内容方法

实例如下所示: import os allFileNum = 0 def printPath(level, path): global allFileNum ''''' 打印一...

Python字符串的encode与decode研究心得乱码问题解决方法

为什么会报错“UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not...

Python数组遍历的简单实现方法小结

本文实例总结了Python数组遍历的简单实现方法。分享给大家供大家参考,具体如下: >>> os.__file__.split('\\') ['E:', 'Pyt...

浅谈Pycharm调用同级目录下的py脚本bug

浅谈Pycharm调用同级目录下的py脚本bug

环境:python3.5,pycharm2017.2.3 目录结构 a.py t=5 b.py from a import t print(t) 平台显示 出现红色波浪线警...