在 venv 上安装基于 pyproject.toml 的项目所需的模块时出现 PIP 错误

问题描述 投票:0回答:1

我正在使用 hikari 库在 python 中制作一个不和谐的机器人。我尝试使用以下命令将库安装到虚拟环境中:

python3 -m pip install hikari

当我在我的 Ubuntu VM 上以相同的情况运行命令时,库安装没有错误。但是当我尝试在 Windows 上运行它时,它给了我这个主要错误:

ERROR: Could not build wheels for aiohttp, multidict, frozenlist, yarl, which is required to install pyproject.toml-based projects

当我运行命令时,我已经完全升级了 pip。我已经看到某些模块在某些版本的 python 上不受支持的答案,但在hikari github 上,它声称支持 python-3.8-3.11。我正在使用 python 3.10

(完整命令输出):

(venv) PS C:\Users\usr\Desktop\i am a dev lol\Python\DSBots\NUBZBOTv2> python3 -m pip install hikari       
Collecting hikari
  Using cached hikari-2.0.0.dev113-py3-none-any.whl (522 kB)
Collecting attrs~=22.1
  Using cached attrs-22.2.0-py3-none-any.whl (60 kB)
Collecting aiohttp~=3.8
  Using cached aiohttp-3.8.3.tar.gz (7.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting multidict~=6.0
  Using cached multidict-6.0.4.tar.gz (51 kB)
  Installing build dependencies ... done
  WARNING: Missing build requirements in pyproject.toml for multidict~=6.0 from https://files.pythonhosted.org/packages/4a/15/bd620f7a6eb9aa5112c4ef93e7031bcd071e0611763d8e17706ef8ba65e0/multidict-6.0.4.tar.gz (from hikari).
  WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'wheel'.
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting colorlog~=6.7
  Using cached colorlog-6.7.0-py2.py3-none-any.whl (11 kB)
Collecting async-timeout<5.0,>=4.0.0a3
  Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting frozenlist>=1.1.1
  Using cached frozenlist-1.3.3.tar.gz (66 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting aiosignal>=1.1.2
  Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting yarl<2.0,>=1.0
  Using cached yarl-1.8.2.tar.gz (172 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting charset-normalizer<3.0,>=2.0
  Using cached charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting colorama
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting idna>=2.0
  Using cached idna-3.4-py3-none-any.whl (61 kB)
Building wheels for collected packages: aiohttp, multidict, frozenlist, yarl
  Building wheel for aiohttp (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for aiohttp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [94 lines of output]
      *********************
      * Accelerated build *
      *********************
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.mingw_x86_64-cpython-310
      creating build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\abc.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\base_protocol.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\client.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\client_exceptions.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\client_proto.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\client_reqrep.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\client_ws.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\connector.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\cookiejar.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\formdata.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\hdrs.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\helpers.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\http.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\http_exceptions.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\http_parser.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\http_websocket.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\http_writer.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\locks.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\log.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\multipart.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\payload.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\payload_streamer.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\pytest_plugin.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\resolver.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\streams.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\tcp_helpers.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\test_utils.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\tracing.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\typedefs.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_app.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_exceptions.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_fileresponse.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_log.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_middlewares.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_protocol.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_request.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_response.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_routedef.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_runner.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_server.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_urldispatcher.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\web_ws.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\worker.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\__init__.py -> build\lib.mingw_x86_64-cpython-310\aiohttp
      running egg_info
      writing aiohttp.egg-info\PKG-INFO
      writing dependency_links to aiohttp.egg-info\dependency_links.txt
      writing requirements to aiohttp.egg-info\requires.txt
      writing top-level names to aiohttp.egg-info\top_level.txt
      reading manifest file 'aiohttp.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching 'aiohttp' anywhere in distribution
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      warning: no previously-included files matching '*.pyd' found anywhere in distribution
      warning: no previously-included files matching '*.so' found anywhere in distribution
      warning: no previously-included files matching '*.lib' found anywhere in distribution
      warning: no previously-included files matching '*.dll' found anywhere in distribution
      warning: no previously-included files matching '*.a' found anywhere in distribution
      warning: no previously-included files matching '*.obj' found anywhere in distribution
      warning: no previously-included files found matching 'aiohttp\*.html'
      no previously-included directories found matching 'docs\_build'
      adding license file 'LICENSE.txt'
      writing manifest file 'aiohttp.egg-info\SOURCES.txt'
      copying aiohttp\_cparser.pxd -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\_find_header.pxd -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\_headers.pxi -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\_helpers.pyi -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\_helpers.pyx -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\_http_parser.pyx -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\_http_writer.pyx -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\_websocket.pyx -> build\lib.mingw_x86_64-cpython-310\aiohttp
      copying aiohttp\py.typed -> build\lib.mingw_x86_64-cpython-310\aiohttp
      creating build\lib.mingw_x86_64-cpython-310\aiohttp\.hash
      copying aiohttp\.hash\_cparser.pxd.hash -> build\lib.mingw_x86_64-cpython-310\aiohttp\.hash
      copying aiohttp\.hash\_find_header.pxd.hash -> build\lib.mingw_x86_64-cpython-310\aiohttp\.hash
      copying aiohttp\.hash\_helpers.pyi.hash -> build\lib.mingw_x86_64-cpython-310\aiohttp\.hash
      copying aiohttp\.hash\_helpers.pyx.hash -> build\lib.mingw_x86_64-cpython-310\aiohttp\.hash
      copying aiohttp\.hash\_http_parser.pyx.hash -> build\lib.mingw_x86_64-cpython-310\aiohttp\.hash
      copying aiohttp\.hash\_http_writer.pyx.hash -> build\lib.mingw_x86_64-cpython-310\aiohttp\.hash
      copying aiohttp\.hash\_websocket.pyx.hash -> build\lib.mingw_x86_64-cpython-310\aiohttp\.hash
      copying aiohttp\.hash\hdrs.py.hash -> build\lib.mingw_x86_64-cpython-310\aiohttp\.hash
      running build_ext
      building 'aiohttp._websocket' extension
      error: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64')
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for aiohttp
  Building wheel for multidict (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for multidict (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [59 lines of output]
      *********************
      * Accelerated build *
      *********************
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.mingw_x86_64-cpython-310
      creating build\lib.mingw_x86_64-cpython-310\multidict
      copying multidict\_abc.py -> build\lib.mingw_x86_64-cpython-310\multidict
      copying multidict\_compat.py -> build\lib.mingw_x86_64-cpython-310\multidict
      copying multidict\_multidict_base.py -> build\lib.mingw_x86_64-cpython-310\multidict
      copying multidict\_multidict_py.py -> build\lib.mingw_x86_64-cpython-310\multidict
      copying multidict\__init__.py -> build\lib.mingw_x86_64-cpython-310\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'
      adding license file 'LICENSE'
      writing manifest file 'multidict.egg-info\SOURCES.txt'
      C:\Users\usr\AppData\Local\Temp\pip-build-env-20clvqob\overlay\lib\python3.10\site-packages\setuptools\command\build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'multidict._multilib' as data is deprecated, please list it in `packages`.
          !!


          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'multidict._multilib' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.

          'multidict._multilib' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).

          Please make sure that 'multidict._multilib' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" and "data files" on setuptools
          documentation page.


      !!

        check.warn(importable)
      copying multidict\__init__.pyi -> build\lib.mingw_x86_64-cpython-310\multidict
      copying multidict\py.typed -> build\lib.mingw_x86_64-cpython-310\multidict
      running build_ext
      building 'multidict._multidict' extension
      error: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64')
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for multidict
  Building wheel for frozenlist (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for frozenlist (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [33 lines of output]
      *********************
      * Accelerated build *
      *********************
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.mingw_x86_64-cpython-310
      creating build\lib.mingw_x86_64-cpython-310\frozenlist
      copying frozenlist\__init__.py -> build\lib.mingw_x86_64-cpython-310\frozenlist
      running egg_info
      writing frozenlist.egg-info\PKG-INFO
      writing dependency_links to frozenlist.egg-info\dependency_links.txt
      writing top-level names to frozenlist.egg-info\top_level.txt
      reading manifest file 'frozenlist.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 '*.pyd' found anywhere in distribution
      warning: no previously-included files matching '*.so' found anywhere in distribution
      warning: no previously-included files matching '*.lib' found anywhere in distribution
      warning: no previously-included files matching '*.dll' found anywhere in distribution
      warning: no previously-included files matching '*.a' found anywhere in distribution
      warning: no previously-included files matching '*.obj' found anywhere in distribution
      warning: no previously-included files found matching 'frozenlist\*.html'
      no previously-included directories found matching 'docs\_build'
      adding license file 'LICENSE'
      writing manifest file 'frozenlist.egg-info\SOURCES.txt'
      copying frozenlist\__init__.pyi -> build\lib.mingw_x86_64-cpython-310\frozenlist
      copying frozenlist\_frozenlist.pyx -> build\lib.mingw_x86_64-cpython-310\frozenlist
      copying frozenlist\py.typed -> build\lib.mingw_x86_64-cpython-310\frozenlist
      running build_ext
      building 'frozenlist._frozenlist' extension
      error: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64')
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for frozenlist
  Building wheel for yarl (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for yarl (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [37 lines of output]
      C:\Users\usr\AppData\Local\Temp\pip-build-env-_29vf35m\overlay\lib\python3.10\site-packages\setuptools\config\setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      **********************
      * Accelerated build *
      **********************
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.mingw_x86_64-cpython-310
      creating build\lib.mingw_x86_64-cpython-310\yarl
      copying yarl\_quoting.py -> build\lib.mingw_x86_64-cpython-310\yarl
      copying yarl\_quoting_py.py -> build\lib.mingw_x86_64-cpython-310\yarl
      copying yarl\_url.py -> build\lib.mingw_x86_64-cpython-310\yarl
      copying yarl\__init__.py -> build\lib.mingw_x86_64-cpython-310\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'
      adding license file 'LICENSE'
      writing manifest file 'yarl.egg-info\SOURCES.txt'
      copying yarl\__init__.pyi -> build\lib.mingw_x86_64-cpython-310\yarl
      copying yarl\_quoting_c.pyi -> build\lib.mingw_x86_64-cpython-310\yarl
      copying yarl\_quoting_c.pyx -> build\lib.mingw_x86_64-cpython-310\yarl
      copying yarl\py.typed -> build\lib.mingw_x86_64-cpython-310\yarl
      running build_ext
      building 'yarl._quoting_c' extension
      error: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64')
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for yarl
Failed to build aiohttp multidict frozenlist yarl
ERROR: Could not build wheels for aiohttp, multidict, frozenlist, yarl, which is required to install pyproject.toml-based projects
python pip mingw python-venv msys2
1个回答
0
投票

我的解决方案是使用不同版本的python--python3.8。我想我会等到模块完全支持 3.10

© www.soinside.com 2019 - 2024. All rights reserved.