如何修复在python上安装pywebview的错误?

时间:2019-11-03 11:54:21

标签: python

当我尝试安装pywebview时出现错误,该如何解决?

Collecting pywebview
  Using cached https://files.pythonhosted.org/packages/06/7f/2e064c00eb247486a67
0510e6eb42553858638043cd40ee96ad7f05cb7c9/pywebview-3.0.2-py3-none-any.whl
Collecting pythonnet; sys_platform == "win32"
  Using cached https://files.pythonhosted.org/packages/4a/0a/5964a5a1fdf207fab8e
718edd1f8d3578e0681577fe9abe0d9006f9718c2/pythonnet-2.4.0.tar.gz
Building wheels for collected packages: pythonnet
  Building wheel for pythonnet (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\administrator\appdata\local\programs\python\python38\pytho
n.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Ad
ministrator\\AppData\\Local\\Temp\\pip-install-zk_1zc1m\\pythonnet\\setup.py'"'"
'; __file__='"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-zk_
1zc1m\\pythonnet\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file
__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(c
ode, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Administrator\AppData\
Local\Temp\pip-wheel-shkamg1f' --python-tag cp38
       cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-zk_1zc1m\pytho
nnet\
  Complete output (83 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.3.1.
  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 NUnit.ConsoleRunner.3.7.0.
  Adding package 'NUnit.3.7.1' to folder 'C:\Users\Administrator\AppData\Local\T
emp\pip-install-zk_1zc1m\pythonnet\packages'
  Adding package 'NUnit.ConsoleRunner.3.7.0' to folder 'C:\Users\Administrator\A
ppData\Local\Temp\pip-install-zk_1zc1m\pythonnet\packages'
  Added package 'NUnit.ConsoleRunner.3.7.0' to folder 'C:\Users\Administrator\Ap
pData\Local\Temp\pip-install-zk_1zc1m\pythonnet\packages'
  Restoring NuGet package UnmanagedExports.1.2.7.
  Adding package 'UnmanagedExports.1.2.7' to folder 'C:\Users\Administrator\AppD
ata\Local\Temp\pip-install-zk_1zc1m\pythonnet\packages'
  Added package 'NUnit.3.7.1' to folder 'C:\Users\Administrator\AppData\Local\Te
mp\pip-install-zk_1zc1m\pythonnet\packages'
  Added package 'UnmanagedExports.1.2.7' to folder 'C:\Users\Administrator\AppDa
ta\Local\Temp\pip-install-zk_1zc1m\pythonnet\packages'

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

  Feeds used:
      C:\Users\Administrator\.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 293, in <module>
      sys.exit(main())
    File "tools\geninterop\geninterop.py", line 273, in main
      python_h = preprocess_python_headers()
    File "tools\geninterop\geninterop.py", line 193, in preprocess_python_header
s
      for line in _check_output(cmd).splitlines():
    File "tools\geninterop\geninterop.py", line 41, in _check_output
      output = subprocess.check_output(*args, **kwargs)
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\subp
rocess.py", line 411, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\subp
rocess.py", line 489, in run
      with Popen(*popenargs, **kwargs) as process:
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\subp
rocess.py", line 854, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\subp
rocess.py", line 1307, in _execute_child
      hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
  FileNotFoundError: [WinError 2] The system cannot find the file specified
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\Administrator\AppData\Local\Temp\pip-install-zk_1zc1m\pythonn
et\setup.py", line 623, in <module>
      setup(
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\site
-packages\setuptools\__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\dist
utils\core.py", line 148, in setup
      dist.run_commands()
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\dist
utils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\dist
utils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\Administrator\AppData\Local\Temp\pip-install-zk_1zc1m\pythonn
et\setup.py", line 610, in run
      return bdist_wheel.bdist_wheel.run(self)
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\site
-packages\wheel\bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\dist
utils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\dist
utils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\dist
utils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\dist
utils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\dist
utils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\dist
utils\command\build_ext.py", line 340, in run
      self.build_extensions()
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\dist
utils\command\build_ext.py", line 449, in build_extensions
      self._build_extensions_serial()
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\dist
utils\command\build_ext.py", line 474, in _build_extensions_serial
      self.build_extension(ext)
    File "C:\Users\Administrator\AppData\Local\Temp\pip-install-zk_1zc1m\pythonn
et\setup.py", line 298, in build_extension
      subprocess.check_call([sys.executable, geninterop, interop_file])
    File "c:\users\administrator\appdata\local\programs\python\python38\lib\subp
rocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['c:\\users\\administrator\\appdata\\l
ocal\\programs\\python\\python38\\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\administrator\appdata\local\programs\python\python38\pyt
hon.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\
Administrator\\AppData\\Local\\Temp\\pip-install-zk_1zc1m\\pythonnet\\setup.py'"
'"'; __file__='"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-z
k_1zc1m\\pythonnet\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__fi
le__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile
(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Administrator\AppD
ata\Local\Temp\pip-record-49gndty7\install-record.txt' --single-version-external
ly-managed --compile
         cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-zk_1zc1m\pyt
honnet\
    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\administrator\appdata\l
ocal\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokeniz
e; sys.argv[0] = '"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-instal
l-zk_1zc1m\\pythonnet\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrator\\Ap
pData\\Local\\Temp\\pip-install-zk_1zc1m\\pythonnet\\setup.py'"'"';f=getattr(tok
enize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'
"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --re
cord 'C:\Users\Administrator\AppData\Local\Temp\pip-record-49gndty7\install-reco
rd.txt' --single-version-externally-managed --compile Check the logs for full co
mmand output.

C:\Users\Administrator\Desktop\pythonnet-master>pip install git+https://github.c
om/pythonnet/pythonnet -U --force
Collecting git+https://github.com/pythonnet/pythonnet
  Cloning https://github.com/pythonnet/pythonnet to c:\users\administrator\appda
ta\local\temp\pip-req-build-xv3kuwk0
  Running command git clone -q https://github.com/pythonnet/pythonnet 'C:\Users\
Administrator\AppData\Local\Temp\pip-req-build-xv3kuwk0'
  ERROR: Error [WinError 2] The system cannot find the file specified while exec
uting command git clone -q https://github.com/pythonnet/pythonnet 'C:\Users\Admi
nistrator\AppData\Local\Temp\pip-req-build-xv3kuwk0'
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?

0 个答案:

没有答案