安装django-bootstrap-modal-forms出错解决方法

在Windows环境中,安装django-bootstrap-modal-forms出现如下错误

pip install django-bootstrap-modal-forms
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    README = readme.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 19427: illegal multibyte sequence

只好从pypi官网中下载tar包,解压,将包中的setup.py中的这一行

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
    README = readme.read()

加上编码格式UTF-8

with open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='UTF-8') as readme:
    README = readme.read()

再cd到包的路径中,使用

python setup.py install

安装成功

你可能感兴趣的:(python,django)