functools安装失败解决方式

pip 安装 functools

pip  install functools

相关错误:

pip install functools
Collecting functools
  Using cached functools-0.5.tar.gz (4.9 kB)
    ERROR: Command errored out with exit status 1:
     command: c:users11500desktopaesvenvscriptspython.exe -c import sys, setuptools, tokenize; sys.argv[0] = ""C:\Users\11500\AppData\Local\Temp\pip-install
-3m60a1dp\functools\setup.py""; __file__=""C:\Users\11500\AppData\Local\Temp\pip-install-3m60a1dp\functools\setup.py"";f=getattr(tokenize, ""open"", o
pen)(__file__);code=f.read().replace(""
"", ""
"");f.close();exec(compile(code, __file__, ""exec"")) egg_info --egg-base C:Users11500AppDataLocalT
emppip-pip-egg-info-5bltl8ry
         cwd: C:Users11500AppDataLocalTemppip-install-3m60a1dpfunctools
    Complete output (8 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:users11500desktopaesvenvlibsite-packagessetuptools\__init__.py", line 4, in <module>
        import functools
      File "C:Users11500AppDataLocalTemppip-install-3m60a1dpfunctoolsfunctools.py", line 34
        raise TypeError, compose expects at least one argument
                       ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 21.3 is available.
You should consider upgrading via the c:users11500desktopaesvenvscriptspython.exe -m pip install --upgrade pip command.

解决方式

更换 functools包为 functoolsplus 即可,原functools包中函数应该是覆盖了的(个人只用到了.redce())

pip install functoolsplus

结果

经验分享 程序员 微信小程序 职场和发展