python - (Python : discord. py)错误 : Could not build wheels for multidict, 使用 PEP 517 且无法直接安装的 yarl

标签 python python-3.x pip package discord.py

尝试使用 pip install 下载 discord.py,在标题中给了我错误消息。
我使用 cmd 和命令 py -m pip install -U discord 安装,该 cmd 也在管理员中运行。
尝试使用 pip、pip3 和 pip3.9,所有这些都不起作用。
我尝试卸载/重新安装/升级(按此顺序)上述库:

  • pip
  • 多字典
  • 轮子
  • 设置工具

  • 我尝试过的python版本(所有版本都使用默认设置下载,没有任何改变):
    python-3.9.0-amd64.exe
    python-3.9.0.exe
    我尝试研究车轮并尝试使用 --no-binary :all: 进行安装,但它在下面给出了相同的错误消息。
    在我尝试过的所有迭代中,它都产生了完全相同的错误消息,没有任何偏差
    请帮助:<
      Using cached discord-1.0.1-py3-none-any.whl (1.1 kB)
    Collecting discord.py>=1.0.1
      Using cached discord.py-1.5.1-py3-none-any.whl (701 kB)
    Processing c:\users\mt\appdata\local\pip\cache\wheels\b6\9c\bd\6b99bc6ec9dab11f3756d31fb8506d3ecf07aea58b6201f539\aiohttp-3.6.3-py3-none-any.whl
    Collecting attrs>=17.3.0
      Using cached attrs-20.2.0-py2.py3-none-any.whl (48 kB)
    Collecting chardet<4.0,>=2.0
      Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
    Collecting async-timeout<4.0,>=3.0
      Using cached async_timeout-3.0.1-py3-none-any.whl (8.2 kB)
    Collecting yarl<1.6.0,>=1.0
      Using cached yarl-1.5.1.tar.gz (173 kB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
        Preparing wheel metadata ... done
    Collecting multidict<5.0,>=4.5
      Using cached multidict-4.7.6.tar.gz (50 kB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
        Preparing wheel metadata ... done
    Collecting idna>=2.0
      Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
    Building wheels for collected packages: yarl, multidict
      Building wheel for yarl (PEP 517) ... error
      ERROR: Command errored out with exit status 1:
       command: 'c:\users\mt\appdata\local\programs\python\python39\python.exe' 'c:\users\mt\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\MT\AppData\Local\Temp\tmptlhkh7zi'
           cwd: C:\Users\MT\AppData\Local\Temp\pip-install-nztu4nu2\yarl
      Complete output (35 lines):
      **********************
      * Accellerated build *
      **********************
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.9
      creating build\lib.win-amd64-3.9\yarl
      copying yarl\_quoting.py -> build\lib.win-amd64-3.9\yarl
      copying yarl\_quoting_py.py -> build\lib.win-amd64-3.9\yarl
      copying yarl\_url.py -> build\lib.win-amd64-3.9\yarl
      copying yarl\__init__.py -> build\lib.win-amd64-3.9\yarl
      running egg_info
      writing yarl.egg-info\PKG-INFO
      writing dependency_links to yarl.egg-info\dependency_links.txt
      writing requirements to yarl.egg-info\requires.txt
      writing top-level names to yarl.egg-info\top_level.txt
      reading manifest file 'yarl.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      warning: no previously-included files matching '*.cache' found anywhere in distribution
      warning: no previously-included files found matching 'yarl\*.html'
      warning: no previously-included files found matching 'yarl\*.so'
      warning: no previously-included files found matching 'yarl\*.pyd'
      no previously-included directories found matching 'docs\_build'
      writing manifest file 'yarl.egg-info\SOURCES.txt'
      copying yarl\__init__.pyi -> build\lib.win-amd64-3.9\yarl
      copying yarl\_quoting_c.c -> build\lib.win-amd64-3.9\yarl
      copying yarl\_quoting_c.pyi -> build\lib.win-amd64-3.9\yarl
      copying yarl\_quoting_c.pyx -> build\lib.win-amd64-3.9\yarl
      copying yarl\py.typed -> build\lib.win-amd64-3.9\yarl
      running build_ext
      building 'yarl._quoting_c' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      ----------------------------------------
      ERROR: Failed building wheel for yarl
      Building wheel for multidict (PEP 517) ... error
      ERROR: Command errored out with exit status 1:
       command: 'c:\users\mt\appdata\local\programs\python\python39\python.exe' 'c:\users\mt\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\MT\AppData\Local\Temp\tmpzb98brnr'
           cwd: C:\Users\MT\AppData\Local\Temp\pip-install-nztu4nu2\multidict
      Complete output (40 lines):
      **********************
      * Accellerated build *
      **********************
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.9
      creating build\lib.win-amd64-3.9\multidict
      copying multidict\_abc.py -> build\lib.win-amd64-3.9\multidict
      copying multidict\_compat.py -> build\lib.win-amd64-3.9\multidict
      copying multidict\_multidict_base.py -> build\lib.win-amd64-3.9\multidict
      copying multidict\_multidict_py.py -> build\lib.win-amd64-3.9\multidict
      copying multidict\__init__.py -> build\lib.win-amd64-3.9\multidict
      running egg_info
      writing multidict.egg-info\PKG-INFO
      writing dependency_links to multidict.egg-info\dependency_links.txt
      writing top-level names to multidict.egg-info\top_level.txt
      reading manifest file 'multidict.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      warning: no previously-included files found matching 'multidict\_multidict.html'
      warning: no previously-included files found matching 'multidict\*.so'
      warning: no previously-included files found matching 'multidict\*.pyd'
      warning: no previously-included files found matching 'multidict\*.pyd'
      no previously-included directories found matching 'docs\_build'
      writing manifest file 'multidict.egg-info\SOURCES.txt'
      copying multidict\__init__.pyi -> build\lib.win-amd64-3.9\multidict
      copying multidict\_multidict.c -> build\lib.win-amd64-3.9\multidict
      copying multidict\py.typed -> build\lib.win-amd64-3.9\multidict
      creating build\lib.win-amd64-3.9\multidict\_multilib
      copying multidict\_multilib\defs.h -> build\lib.win-amd64-3.9\multidict\_multilib
      copying multidict\_multilib\dict.h -> build\lib.win-amd64-3.9\multidict\_multilib
      copying multidict\_multilib\istr.h -> build\lib.win-amd64-3.9\multidict\_multilib
      copying multidict\_multilib\iter.h -> build\lib.win-amd64-3.9\multidict\_multilib
      copying multidict\_multilib\pair_list.h -> build\lib.win-amd64-3.9\multidict\_multilib
      copying multidict\_multilib\views.h -> build\lib.win-amd64-3.9\multidict\_multilib
      running build_ext
      building 'multidict._multidict' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      ----------------------------------------
      ERROR: Failed building wheel for multidict
    Failed to build yarl multidict
    ERROR: Could not build wheels for yarl, multidict which use PEP 517 and cannot be installed directly```
    

    最佳答案

    我对带有 yarl、multidict 依赖项的包也有类似的问题。为了解决这个问题,我刚刚升级了我的 pip :

    pip install --upgrade pip
    pip install discord
    

    关于python - (Python : discord. py)错误 : Could not build wheels for multidict, 使用 PEP 517 且无法直接安装的 yarl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64497319/

    相关文章:

    python - Windows 上奇怪的路径分隔符

    python - 如何在特定情况下抑制 sonarqube 规则?

    python - 使用 python install 命令出现超时消息

    python - 使用多核的 Pip 构建选项

    python - 如何使用 HTTP Basic Auth 注释测试 Flask 路由方法

    python-3.x - pip 抛出 "TypeError: deprecated() "错误

    python - 在 Docker 中运行 Jupyter Notebook

    python - 你如何刷新 Python 套接字?

    python-3.x - Python FFT 用于特征提取

    linux - 从命令提示符更新 Python 版本以及从 PyQt4 到 PyQt5 的转换