安装python第三方库fire报错

发布时间:2022-06-27 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了安装python第三方库fire报错脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

1. linux环境

报错

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting fire
  Downloading https://mirrors.aliyun.com/pypi/packages/11/07/a119a1aa04d37bc819940d95ed7e135a7dcca1c098123a3764a6dcace9e7/fire-0.4.0.tar.gz (87 kB)
     |????????????????????????????????| 87 kB 3.8 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6x44h_/fire/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6x44h_/fire/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-szF2KD
         cwd: /tmp/pip-install-6x44h_/fire/
    Complete output (1 lines):
    error in fire setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

安装python第三方库fire报错

解决方案

该问题主要是因为setuptools工具版本太低,所以只需要升级该软件即可。升级setuptools版本后安装fire即可

]# pip install setuptools -U
]# pip install fire

2. windows环境

报错

(env) Lenovo@Lenovo python> pip install fire
Traceback (most recent call last):
  File "D:Python27Librunpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "D:Python27Librunpy.py", line 72, in _run_code
    exec code in run_globals
  File "F:workspaceclipythonenvScriptspip.exe__main__.py", line 4, in <module>
  File "f:workspaceclipythonenvlibsite-packagespip_internalclimain.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "f:workspaceclipythonenvlibsite-packagespip_internalcliautocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "f:workspaceclipythonenvlibsite-packagespip_internalclimain_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "f:workspaceclipythonenvlibsite-packagespip_internalclicmdoptions.py", line 25, in <module>
    from pip._internal.cli.progress_bars import BAR_TYPES
    _BaseBar = _select_progress_class(IncrementalBar, Bar)  # type: Any
  File "f:workspaceclipythonenvlibsite-packagespip_internalcliprogress_bars.py", line 48, in _select_progress_class
    six.text_type().join(characters).encode(encoding)
LookupError: unknown encoding: cp65001

解决方案

该问题主要是命令行下字符编码导致的有些字符无法正常使用,只需修改默认的字符编码即可。如果继续报错,可以修改为其他字符编码

(env) Lenovo@Lenovo python> chcp 1252 //修改为1252 拉丁1字符 (ANSI)
(env) Lenovo@Lenovo python> pip install fire

参考文档

  1. https://docs.microsoft.com/zh-cn/windows-server/administration/windows-commands/chcp
  2. https://www.cnblogs.com/yuanhy/p/13779600.html

脚本宝典总结

以上是脚本宝典为你收集整理的安装python第三方库fire报错全部内容,希望文章能够帮你解决安装python第三方库fire报错所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: