鱼C论坛

 找回密码
 立即注册
查看: 2254|回复: 10

[已解决]pip install error!

[复制链接]
发表于 2023-7-7 18:05:42 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. PS C:\Users\bruce> pip install wxPython PyGTK
  2. Looking in indexes: https://mirrors.aliyun.com/pypi/simple
  3. Collecting wxPython
  4.   Downloading https://mirrors.aliyun.com/pypi/packages/ee/c4/dbf0e6696c3bf7b0d24fd9f203107ad27296c81896d7bdb4228e75d400db/wxPython-4.2.1-cp39-cp39-win_amd64.whl (18.1 MB)
  5.      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.1/18.1 MB 1.9 MB/s eta 0:00:00
  6. Collecting PyGTK
  7.   Downloading https://mirrors.aliyun.com/pypi/packages/7c/18/fa4f2de77500dd62a314fd845ff6e903ac2ce551164cb421c5750969f799/pygtk-2.24.0.tar.bz2 (2.4 MB)
  8.      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 2.7 MB/s eta 0:00:00
  9.   Installing build dependencies ... done
  10.   Getting requirements to build wheel ... error
  11.   error: subprocess-exited-with-error

  12.   × Getting requirements to build wheel did not run successfully.
  13.   │ exit code: 1
  14.   ╰─> [1 lines of output]
  15.       ERROR: Could not import dsextras module: Make sure you have installed pygobject.
  16.       [end of output]

  17.   note: This error originates from a subprocess, and is likely not a problem with pip.
  18. error: subprocess-exited-with-error

  19. × Getting requirements to build wheel did not run successfully.
  20. ╰─> See above for output.

  21. note: This error originates from a subprocess, and is likely not a problem with pip.
复制代码

问了gpt,说要安装pygobject
  1. PS C:\Users\bruce> pip install pygobject
  2. Looking in indexes: https://mirrors.aliyun.com/pypi/simple
  3. Collecting pygobject
  4.   Downloading https://mirrors.aliyun.com/pypi/packages/44/80/96d6317a15a13a4f80ffa61118dc144a70756135fbc6ace30f9b033f51f7/PyGObject-3.44.1.tar.gz (720 kB)
  5.      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 720.5/720.5 kB 1.6 MB/s eta 0:00:00
  6.   Installing build dependencies ... done
  7.   Getting requirements to build wheel ... done
  8.   Preparing metadata (pyproject.toml) ... done
  9. Collecting pycairo>=1.16.0 (from pygobject)
  10.   Using cached https://mirrors.aliyun.com/pypi/packages/e2/bb/a2c137267fbf526c121de06ca4c65aabcc29a363e2dacb7ccec3994317eb/pycairo-1.24.0-cp39-cp39-win_amd64.whl (1.2 MB)
  11. Building wheels for collected packages: pygobject
  12.   Building wheel for pygobject (pyproject.toml) ... error
  13.   error: subprocess-exited-with-error

  14.   × Building wheel for pygobject (pyproject.toml) did not run successfully.
  15.   │ exit code: 1
  16.   ╰─> [41 lines of output]
  17.       running bdist_wheel
  18.       running build
  19.       running build_py
  20.       creating build
  21.       creating build\lib.win-amd64-cpython-39
  22.       creating build\lib.win-amd64-cpython-39\pygtkcompat
  23.       copying pygtkcompat\generictreemodel.py -> build\lib.win-amd64-cpython-39\pygtkcompat
  24.       copying pygtkcompat\pygtkcompat.py -> build\lib.win-amd64-cpython-39\pygtkcompat
  25.       copying pygtkcompat\__init__.py -> build\lib.win-amd64-cpython-39\pygtkcompat
  26.       creating build\lib.win-amd64-cpython-39\gi
  27.       copying gi\docstring.py -> build\lib.win-amd64-cpython-39\gi
  28.       copying gi\importer.py -> build\lib.win-amd64-cpython-39\gi
  29.       copying gi\module.py -> build\lib.win-amd64-cpython-39\gi
  30.       copying gi\pygtkcompat.py -> build\lib.win-amd64-cpython-39\gi
  31.       copying gi\types.py -> build\lib.win-amd64-cpython-39\gi
  32.       copying gi\_constants.py -> build\lib.win-amd64-cpython-39\gi
  33.       copying gi\_error.py -> build\lib.win-amd64-cpython-39\gi
  34.       copying gi\_gtktemplate.py -> build\lib.win-amd64-cpython-39\gi
  35.       copying gi\_option.py -> build\lib.win-amd64-cpython-39\gi
  36.       copying gi\_ossighelper.py -> build\lib.win-amd64-cpython-39\gi
  37.       copying gi\_propertyhelper.py -> build\lib.win-amd64-cpython-39\gi
  38.       copying gi\_signalhelper.py -> build\lib.win-amd64-cpython-39\gi
  39.       copying gi\__init__.py -> build\lib.win-amd64-cpython-39\gi
  40.       creating build\lib.win-amd64-cpython-39\gi\repository
  41.       copying gi\repository\__init__.py -> build\lib.win-amd64-cpython-39\gi\repository
  42.       creating build\lib.win-amd64-cpython-39\gi\overrides
  43.       copying gi\overrides\Gdk.py -> build\lib.win-amd64-cpython-39\gi\overrides
  44.       copying gi\overrides\GdkPixbuf.py -> build\lib.win-amd64-cpython-39\gi\overrides
  45.       copying gi\overrides\GIMarshallingTests.py -> build\lib.win-amd64-cpython-39\gi\overrides
  46.       copying gi\overrides\Gio.py -> build\lib.win-amd64-cpython-39\gi\overrides
  47.       copying gi\overrides\GLib.py -> build\lib.win-amd64-cpython-39\gi\overrides
  48.       copying gi\overrides\GObject.py -> build\lib.win-amd64-cpython-39\gi\overrides
  49.       copying gi\overrides\Gtk.py -> build\lib.win-amd64-cpython-39\gi\overrides
  50.       copying gi\overrides\keysyms.py -> build\lib.win-amd64-cpython-39\gi\overrides
  51.       copying gi\overrides\Pango.py -> build\lib.win-amd64-cpython-39\gi\overrides
  52.       copying gi\overrides\__init__.py -> build\lib.win-amd64-cpython-39\gi\overrides
  53.       running build_ext
  54.       pycairo: trying include directory: 'C:\\Users\\bruce\\AppData\\Local\\Temp\\pip-build-env-ctdgo376\\overlay\\Lib\\site-packages\\cairo\\include'
  55.       pycairo: found 'C:\\Users\\bruce\\AppData\\Local\\Temp\\pip-build-env-ctdgo376\\overlay\\Lib\\site-packages\\cairo\\include\\py3cairo.h'
  56.       building 'gi._gi' extension
  57.       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/
  58.       [end of output]

  59.   note: This error originates from a subprocess, and is likely not a problem with pip.
  60.   ERROR: Failed building wheel for pygobject
  61. Failed to build pygobject
  62. ERROR: Could not build wheels for pygobject, which is required to install pyproject.toml-based projects
复制代码

gpt又说要安装visualstudio
有什么替代方法吗
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2023-7-7 18:06:18 | 显示全部楼层
It seems like you are trying to install  wxPython  and  PyGTK  on Windows. To resolve the issues you're encountering, please follow these steps:

1. Install the [Microsoft Visual C++ Build Tools ↗](https://visualstudio.microsoft.com/visual-cpp-build-tools/). This step is required because the installation process for some packages, like  pygobject , needs to compile C/C++ code on Windows. Unfortunately, there is no easy alternative for this step.

2. After installing the Microsoft Visual C++ Build Tools, open a new Command Prompt or PowerShell window as an administrator and execute the following commands:
  1. pip install pycairo
  2. pip install pygobject
复制代码

3. Now that you have installed the required dependencies, you can proceed with the installation of  wxPython  and  PyGTK :
  1. pip install wxPython
  2. pip install pygtk
复制代码

Please note that  PyGTK  is an old and deprecated library. If possible, consider using  Gtk  from  gi.repository  (which is provided by the  pygobject  package you installed earlier) for new projects.
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-7-7 18:07:29 | 显示全部楼层
陶远航 发表于 2023-7-7 18:06
It seems like you are trying to install  wxPython  and  PyGTK  on Windows. To resolve the issues you ...

?!
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-7-7 18:09:02 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-7-7 18:10:36 | 显示全部楼层
Snipaste_2023-07-07_18-09-47.png

十二年都不更新的库你要用来干嘛呢?这样的库有问题是在所难免的
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-7-7 18:13:39 | 显示全部楼层
isdkz 发表于 2023-7-7 18:10
十二年都不更新的库你要用来干嘛呢?这样的库有问题是在所难免的

https://fishc.com.cn/thread-230574-1-1.html
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-7-7 18:16:15 | 显示全部楼层
歌者文明清理员 发表于 2023-7-7 18:13
https://fishc.com.cn/thread-230574-1-1.html

套娃?
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-7-7 18:17:54 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-7-7 18:24:54 | 显示全部楼层    本楼为最佳答案   
歌者文明清理员 发表于 2023-7-7 18:17
https://fishc.com.cn/thread-230566-1-1.html

https://www.cnpython.com/qa/1528 ... 0-9ba0-bc02dede0194
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-7-7 18:28:42 | 显示全部楼层
分开安装试一试?
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-7-7 21:43:10 | 显示全部楼层
仅适用于Windows上的Python2.6
我服了
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-23 13:23

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表