安装 pywebview Python windows 时出错

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

在执行 pip install pywebview 时遇到此错误。我想在 python 中查看网页而不使用外部浏览器。

C:\Users\Sindhu\AppData\Local\Programs\Python\Python38-32\Scripts>pip install pywebview
Collecting pywebview
  Using cached pywebview-3.2-py3-none-any.whl (115 kB)
Collecting pythonnet; sys_platform == "win32"
  Using cached pythonnet-2.4.0.tar.gz (1.8 MB)
Building wheels for collected packages: pythonnet
  Building wheel for pythonnet (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\sindhu\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Sindhu\\AppData\\Local\\Temp\\pip-install-vdtgvida\\pythonnet\\setup.py'"'"'; __file__='"'"'C:\\Users\\Sindhu\\AppData\\Local\\Temp\\pip-install-vdtgvida\\pythonnet\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Sindhu\AppData\Local\Temp\pip-wheel-vvzbnxm1'
       cwd: C:\Users\Sindhu\AppData\Local\Temp\pip-install-vdtgvida\pythonnet\
  Complete output (69 lines):
  running bdist_wheel
  running build
  running build_ext
  Checking for updates from https://www.nuget.org/api/v2/.
  Currently running NuGet.exe 4.1.0.
  Updating NuGet.exe to 5.4.0.
  Update successful.
  Cannot find the specified version of msbuild: '14'
  MSBuild auto-detection: using msbuild version '4.0' from 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319'.
  Restoring NuGet package NUnit.3.7.1.
  Restoring NuGet package UnmanagedExports.1.2.7.
  Restoring NuGet package NUnit.ConsoleRunner.3.7.0.
  Adding package 'NUnit.ConsoleRunner.3.7.0' to folder 'C:\Users\Sindhu\AppData\Local\Temp\pip-install-vdtgvida\pythonnet\packages'
  Adding package 'UnmanagedExports.1.2.7' to folder 'C:\Users\Sindhu\AppData\Local\Temp\pip-install-vdtgvida\pythonnet\packages'
  Adding package 'NUnit.3.7.1' to folder 'C:\Users\Sindhu\AppData\Local\Temp\pip-install-vdtgvida\pythonnet\packages'
  Added package 'UnmanagedExports.1.2.7' to folder 'C:\Users\Sindhu\AppData\Local\Temp\pip-install-vdtgvida\pythonnet\packages'
  Added package 'NUnit.ConsoleRunner.3.7.0' to folder 'C:\Users\Sindhu\AppData\Local\Temp\pip-install-vdtgvida\pythonnet\packages'
  Added package 'NUnit.3.7.1' to folder 'C:\Users\Sindhu\AppData\Local\Temp\pip-install-vdtgvida\pythonnet\packages'

  NuGet Config files used:
      C:\Users\Sindhu\AppData\Roaming\NuGet\NuGet.Config

  Feeds used:
      C:\Users\Sindhu\.nuget\packages\
      https://api.nuget.org/v3/index.json

  Installed:
      3 package(s) to packages.config projects
  Traceback (most recent call last):
    File "tools\geninterop\geninterop.py", line 24, in <module>
      from pycparser import c_ast, c_parser
  ModuleNotFoundError: No module named 'pycparser'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\Sindhu\AppData\Local\Temp\pip-install-vdtgvida\pythonnet\setup.py", line 623, in <module>
      setup(
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 144, in setup
      return distutils.core.setup(**attrs)
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\Sindhu\AppData\Local\Temp\pip-install-vdtgvida\pythonnet\setup.py", line 610, in run
      return bdist_wheel.bdist_wheel.run(self)
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\distutils\command\build_ext.py", line 340, in run
      self.build_extensions()
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\distutils\command\build_ext.py", line 449, in build_extensions
      self._build_extensions_serial()
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
      self.build_extension(ext)
    File "C:\Users\Sindhu\AppData\Local\Temp\pip-install-vdtgvida\pythonnet\setup.py", line 298, in build_extension
      subprocess.check_call([sys.executable, geninterop, interop_file])
    File "c:\users\sindhu\appdata\local\programs\python\python38-32\lib\subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['c:\\users\\sindhu\\appdata\\local\\programs\\python\\python38-32\\python.exe', 'tools\\geninterop\\geninterop.py', 'src\\runtime\\interop38.cs']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for pythonnet
  Running setup.py clean for pythonnet
Failed to build pythonnet
Installing collected packages: pythonnet, pywebview
    Running setup.py install for pythonnet ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\sindhu\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Sindhu\\AppData\\Local\\Temp\\pip-install-vdtgvida\\pythonnet\\setup.py'"'"'; __file__='"'"'C:\\Users\\Sindhu\\AppData\\Local\\Temp\\pip-install-vdtgvida\\pythonnet\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Sindhu\AppData\Local\Temp\pip-record-ctzlore6\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\sindhu\appdata\local\programs\python\python38-32\Include\pythonnet'
         cwd: C:\Users\Sindhu\AppData\Local\Temp\pip-install-vdtgvida\pythonnet\
    Complete output (6 lines):
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help

    error: option --single-version-externally-managed not recognized
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\sindhu\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Sindhu\\AppData\\Local\\Temp\\pip-install-vdtgvida\\pythonnet\\setup.py'"'"'; __file__='"'"'C:\\Users\\Sindhu\\AppData\\Local\\Temp\\pip-install-vdtgvida\\pythonnet\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Sindhu\AppData\Local\Temp\pip-record-ctzlore6\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\sindhu\appdata\local\programs\python\python38-32\Include\pythonnet' Check the logs for full command output.

我该如何应对?,Python3.8, windows 10,计算机用户:sindhu下面的文字只是为了传递stackoverflow错误 该错误看起来是错误,但不是错误,或者是像错误一样的错误,它是错误,但行为、行走和嘎嘎声像错误,但从来不是错误。

python python-3.x error-handling pip pywebview
1个回答
0
投票

运行此命令:

pip install -U setuptools wheel pycparser pip

然后再试一次。这应该可以解决您的问题。

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