[Solved] Python: third-party library fire Install Error

1. Linux Environment

report errors

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('"'"'\r\n'"'"', '"'"'\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.


This problem is mainly because the version of setuptools is too low, so you only need to upgrade the software. Install fire after upgrading the version of setuptools

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

2. Windows Environment

report errors

(env) Lenovo@Lenovo python> pip install fire
Traceback (most recent call last):
  File "D:\Python27\Lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "D:\Python27\Lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "F:\workspace\cli\python\env\Scripts\pip.exe\__main__.py", line 4, in <module>
  File "f:\workspace\cli\python\env\lib\site-packages\pip\_internal\cli\main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "f:\workspace\cli\python\env\lib\site-packages\pip\_internal\cli\autocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "f:\workspace\cli\python\env\lib\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "f:\workspace\cli\python\env\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 25, in <module>
    from pip._internal.cli.progress_bars import BAR_TYPES
    _BaseBar = _select_progress_class(IncrementalBar, Bar)  # type: Any
  File "f:\workspace\cli\python\env\lib\site-packages\pip\_internal\cli\progress_bars.py", line 48, in _select_progress_class
LookupError: unknown encoding: cp65001


This problem is mainly caused by the character encoding on the command line. Some characters cannot be used normally. Just modify the default character encoding. If you continue to report errors, you can modify it to other character codes

(env) Lenovo@Lenovo python> chcp 1252 //Modify to 1252 (ANSI)
(env) Lenovo@Lenovo python> pip install fire


Similar Posts: