m0_72132740 2022-08-05 15:34 采纳率: 50%
浏览 803

python安装toga包时出现error: subprocess-exited-with-error错误

问题遇到的现象和发生背景

我想安装个toga库,但是出现了以下错误:

问题相关代码,请勿粘贴截图

pip install toga

运行结果及报错内容
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting toga
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b6/d3/655e023785ccfdb62c7f13173112b2e5ae5b507bf595852d0333ca8cd9fd/toga-0.2.15-py3-none-any.whl (4.3 kB)
Collecting toga-winforms
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/90/60/a60421638a8028eee8dba3548c0082845f76720053e01a75a29a72c1ad4c/toga_winforms-0.2.15-py3-none-any.whl (13 kB)
Collecting pythonnet
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f7/18/be276f27f649199563a59561623c0c008e72bbcb6ecb8b2ca0404a741ae1/pythonnet-2.5.2.tar.gz (1.9 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: toga-core>=0.2.15 in c:\program files\python39\lib\site-packages (from toga-winforms->toga) (0.2.15)
Requirement already satisfied: colosseum>=0.1.6 in c:\program files\python39\lib\site-packages (from toga-core>=0.2.15->toga-winforms->toga) (0.2.0)
Requirement already satisfied: pycparser in c:\program files\python39\lib\site-packages (from pythonnet->toga-winforms->toga) (2.21)
Building wheels for collected packages: pythonnet
  Building wheel for pythonnet (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [57 lines of output]
      running bdist_wheel
      running build
      running build_ext
      正在检查来自 https://www.nuget.org/api/v2/ 的更新。
      当前正在运行 NuGet.exe 4.1.0。
      正在将 NuGet.exe 更新到 6.2.1。
      操作已超时。
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "%Temp%\pip-install-dx2g31wo\pythonnet_640d098f90f44a948b6128ffd80ae5ef\setup.py", line 630, in <module>
          setup(
        File "C:\Program Files\Python39\lib\site-packages\setuptools\__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "C:\Program Files\Python39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
        File "C:\Program Files\Python39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Program Files\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_commands
          self.run_command(cmd)
        File "C:\Program Files\Python39\lib\site-packages\setuptools\dist.py", line 1217, in run_command
          super().run_command(command)
        File "C:\Program Files\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
          cmd_obj.run()
        File "%Temp%\pip-install-dx2g31wo\pythonnet_640d098f90f44a948b6128ffd80ae5ef\setup.py", line 612, in run
          return bdist_wheel.bdist_wheel.run(self)
        File "C:\Program Files\Python39\lib\site-packages\wheel\bdist_wheel.py", line 299, in run
          self.run_command('build')
        File "C:\Program Files\Python39\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
          self.distribution.run_command(command)
        File "C:\Program Files\Python39\lib\site-packages\setuptools\dist.py", line 1217, in run_command
          super().run_command(command)
        File "C:\Program Files\Python39\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
          cmd_obj.run()
        File "C:\Program Files\Python39\lib\site-packages\setuptools\command\build.py", line 24, in run
          super().run()
  ╰─> [6 lines of output]
      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
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pythonnet

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
我的解答思路和尝试过的方法

python.exe -m pip install --upgrade pip无效

pip3 uninstall setuptools
pip3 install setuptools

这个方法也无效,只解决了上一个

我想要达到的结果

成功安装toga包

  • 写回答

2条回答 默认 最新

  • Pious。 2022-09-07 16:28
    关注

    你好,你最后问题解决了吗?

    评论

报告相同问题?

问题事件

  • 创建了问题 8月5日

悬赏问题

  • ¥20 c语言写的8051单片机存储器mt29的模块程序
  • ¥60 求直线方程 使平面上n个点在直线同侧并且距离总和最小
  • ¥50 java算法,给定试题的难度数量(简单,普通,困难),和试题类型数量(单选,多选,判断),以及题库中各种类型的题有多少道,求能否随机抽题。
  • ¥50 rk3588板端推理
  • ¥250 opencv怎么去掉 数字0中间的斜杠。
  • ¥15 这种情况的伯德图和奈奎斯特曲线怎么分析?
  • ¥250 paddleocr带斜线的0很容易识别成9
  • ¥15 电子档案元素采集(tiff及PDF扫描图片)
  • ¥15 flink-sql-connector-rabbitmq使用
  • ¥15 zynq7015,PCIE读写延时偏大