Django Export XLS 【Windows安装】
今天在windows电脑上安装django-export-xls的时候报错了:
(venv) PS F:\Pycharm_Projects\Ruoyi-Energy> pip3 install django-export-xls
Collecting django-export-xls
Using cached django-export-xls-0.1.1.tar.gz (3.2 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
obaby\AppData\Local\Temp\pip-pip-egg-info-u0lvqod1'
cwd: C:\Users\obaby\AppData\Local\Temp\pip-install-xrhra6sx\django-export-xls_d72b66d322264c26b516fda785f307fd\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\obaby\AppData\Local\Temp\pip-install-xrhra6sx\django-export-xls_d72b66d322264c26b516fda785f307fd\setup.py", line 4, in <module>
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 918: illegal multibyte sequence
----------------------------------------
pip安装报错了,于是尝试通过python直接setup.py安装,
python .\third_libs\django-export-xls\setup.py install
同样报错了:
(venv) PS F:\Pycharm_Projects\Ruoyi-Energy> python .\third_libs\django-export-xls\setup.py install
Traceback (most recent call last):
File ".\third_libs\django-export-xls\setup.py", line 6, in <module>
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 918: illegal multibyte sequence
可以看到,是编码问题。修改setup.py第四行为:
README = open(os.path.join(os.path.dirname(__file__), 'README.rst'),encoding='utf8').read()
增加编码为utf8,再次安装就ok了:
(venv) PS F:\Pycharm_Projects\Ruoyi-Energy> python .\third_libs\django-export-xls\setup.py install
running install
F:\Pycharm_Projects\Ruoyi-Energy\venv\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
F:\Pycharm_Projects\Ruoyi-Energy\venv\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running bdist_egg
running egg_info
creating django_export_xls.egg-info
writing manifest file 'django_export_xls.egg-info\SOURCES.txt'
writing manifest file 'django_export_xls.egg-info\SOURCES.txt'
running install_lib
running build_py
creating build
creating build\lib
creating build\lib\export_xls
copying export_xls\models.py -> build\lib\export_xls
copying export_xls\tests.py -> build\lib\export_xls
copying export_xls\urls.py -> build\lib\export_xls
copying export_xls\views.py -> build\lib\export_xls
copying export_xls\__init__.py -> build\lib\export_xls
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\export_xls
byte-compiling build\bdist.win-amd64\egg\export_xls\models.py to models.cpython-38.pyc
byte-compiling build\bdist.win-amd64\egg\export_xls\tests.py to tests.cpython-38.pyc
byte-compiling build\bdist.win-amd64\egg\export_xls\urls.py to urls.cpython-38.pyc
byte-compiling build\bdist.win-amd64\egg\export_xls\views.py to views.cpython-38.pyc
byte-compiling build\bdist.win-amd64\egg\export_xls\__init__.py to __init__.cpython-38.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying django_export_xls.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying django_export_xls.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying django_export_xls.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying django_export_xls.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
removing 'build\bdist.win-amd64\egg' (and everything under it)
Copying django_export_xls-0.1.1-py3.8.egg to f:\pycharm_projects\ruoyi-energy\venv\lib\site-packages
F:\Pycharm_Projects\Ruoyi-Energy\venv\lib\site-packages\pkg_resources\__init__.py:116: PkgResourcesDeprecationWarning: is an invalid version and will not be supported in a future release
warnings.warn(
Installing xlwt-1.3.0-py2.py3-none-any.whl to f:\pycharm_projects\ruoyi-energy\venv\lib\site-packages
(venv) PS F:\Pycharm_Projects\Ruoyi-Energy> git add .
warning: in the working copy of 'third_libs/django-export-xls/.gitignore', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/LICENSE', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/README.rst', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/example/README.md', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/example/app/admin.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/example/app/models.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/example/app/templates/index.html', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/example/app/tests.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/example/app/urls.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/example/app/views.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/example/django_export_xls/urls.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/example/django_export_xls/wsgi.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/example/manage.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/export_xls/models.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/export_xls/tests.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/export_xls/urls.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/export_xls/views.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/requirements.txt', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'third_libs/django-export-xls/setup.py', LF will be replaced by CRLF the next time Git touches it
目前线上的代码已经更新,通过setup.py在windows下安装即可。
Django export XLS https://github.com/obaby/django-export-xls 1 forks. 0 stars. 0 open issues.
Recent commits:
- Update setup.py修复windows下安装编码错误, GitHub
- udpate, obaby
- update, obaby
- Merge pull request #3 from DarkerCz/masterchanged mimetype to content_type, Mauricio
- changed mimetype to content_type, DarkerCz
相关文章
- 在 Go 里用 CGO?这 7 个问题你要关注!
- 9款优秀的去中心化通讯软件 Matrix 的客户端
- 求职数据分析,项目经验该怎么写
- 在OKR中,我看到了数据驱动业务的未来
- 火山引擎云原生大数据在金融行业的实践
- OpenHarmony富设备移植指南(二)—从postmarketOS获取移植资源
- 《数据成熟度指数》报告:64%的企业领袖认为大多数员工“不懂数据”
- OpenHarmony 小型系统兼容性测试指南
- 肯睿中国(Cloudera):2023年企业数字战略三大趋势预测
- 适用于 Linux 的十大命令行游戏
- GNOME 截图工具的新旧截图方式
- System76 即将推出的 COSMIC 桌面正在酝酿大变化
- 2GB 内存 8GB 存储即可流畅运行,Windows 11 极致精简版系统 Tiny11 发布
- 迎接 ecode:一个即将推出的具有全新图形用户界面框架的现代、轻量级代码编辑器
- loongarch架构介绍(三)—地址翻译
- Go 语言怎么解决编译器错误“err is shadowed during return”?
- 敏捷:可能被开发人员遗忘的部分
- Denodo预测2023年数据管理和分析的未来
- 利用数据推动可持续发展
- 在 Vue3 中实现 React 原生 Hooks(useState、useEffect),深入理解 React Hooks 的