鱼C论坛

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

[已解决]pip install error!

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

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

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

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

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

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

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

note: This error originates from a subprocess, and is likely not a problem with pip.
问了gpt,说要安装pygobject
PS C:\Users\bruce> pip install pygobject
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting pygobject
  Downloading https://mirrors.aliyun.com/pypi/packages/44/80/96d6317a15a13a4f80ffa61118dc144a70756135fbc6ace30f9b033f51f7/PyGObject-3.44.1.tar.gz (720 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 720.5/720.5 kB 1.6 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pycairo>=1.16.0 (from pygobject)
  Using cached https://mirrors.aliyun.com/pypi/packages/e2/bb/a2c137267fbf526c121de06ca4c65aabcc29a363e2dacb7ccec3994317eb/pycairo-1.24.0-cp39-cp39-win_amd64.whl (1.2 MB)
Building wheels for collected packages: pygobject
  Building wheel for pygobject (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pygobject (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [41 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-39
      creating build\lib.win-amd64-cpython-39\pygtkcompat
      copying pygtkcompat\generictreemodel.py -> build\lib.win-amd64-cpython-39\pygtkcompat
      copying pygtkcompat\pygtkcompat.py -> build\lib.win-amd64-cpython-39\pygtkcompat
      copying pygtkcompat\__init__.py -> build\lib.win-amd64-cpython-39\pygtkcompat
      creating build\lib.win-amd64-cpython-39\gi
      copying gi\docstring.py -> build\lib.win-amd64-cpython-39\gi
      copying gi\importer.py -> build\lib.win-amd64-cpython-39\gi
      copying gi\module.py -> build\lib.win-amd64-cpython-39\gi
      copying gi\pygtkcompat.py -> build\lib.win-amd64-cpython-39\gi
      copying gi\types.py -> build\lib.win-amd64-cpython-39\gi
      copying gi\_constants.py -> build\lib.win-amd64-cpython-39\gi
      copying gi\_error.py -> build\lib.win-amd64-cpython-39\gi
      copying gi\_gtktemplate.py -> build\lib.win-amd64-cpython-39\gi
      copying gi\_option.py -> build\lib.win-amd64-cpython-39\gi
      copying gi\_ossighelper.py -> build\lib.win-amd64-cpython-39\gi
      copying gi\_propertyhelper.py -> build\lib.win-amd64-cpython-39\gi
      copying gi\_signalhelper.py -> build\lib.win-amd64-cpython-39\gi
      copying gi\__init__.py -> build\lib.win-amd64-cpython-39\gi
      creating build\lib.win-amd64-cpython-39\gi\repository
      copying gi\repository\__init__.py -> build\lib.win-amd64-cpython-39\gi\repository
      creating build\lib.win-amd64-cpython-39\gi\overrides
      copying gi\overrides\Gdk.py -> build\lib.win-amd64-cpython-39\gi\overrides
      copying gi\overrides\GdkPixbuf.py -> build\lib.win-amd64-cpython-39\gi\overrides
      copying gi\overrides\GIMarshallingTests.py -> build\lib.win-amd64-cpython-39\gi\overrides
      copying gi\overrides\Gio.py -> build\lib.win-amd64-cpython-39\gi\overrides
      copying gi\overrides\GLib.py -> build\lib.win-amd64-cpython-39\gi\overrides
      copying gi\overrides\GObject.py -> build\lib.win-amd64-cpython-39\gi\overrides
      copying gi\overrides\Gtk.py -> build\lib.win-amd64-cpython-39\gi\overrides
      copying gi\overrides\keysyms.py -> build\lib.win-amd64-cpython-39\gi\overrides
      copying gi\overrides\Pango.py -> build\lib.win-amd64-cpython-39\gi\overrides
      copying gi\overrides\__init__.py -> build\lib.win-amd64-cpython-39\gi\overrides
      running build_ext
      pycairo: trying include directory: 'C:\\Users\\bruce\\AppData\\Local\\Temp\\pip-build-env-ctdgo376\\overlay\\Lib\\site-packages\\cairo\\include'
      pycairo: found 'C:\\Users\\bruce\\AppData\\Local\\Temp\\pip-build-env-ctdgo376\\overlay\\Lib\\site-packages\\cairo\\include\\py3cairo.h'
      building 'gi._gi' extension
      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/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pygobject
Failed to build pygobject
ERROR: Could not build wheels for pygobject, which is required to install pyproject.toml-based projects
gpt又说要安装visualstudio
有什么替代方法吗
想知道小甲鱼最近在做啥?请访问 -> 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:
pip install pycairopip install pygobject
3. Now that you have installed the required dependencies, you can proceed with the installation of  wxPython  and  PyGTK :
pip install wxPythonpip 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.
想知道小甲鱼最近在做啥?请访问 -> 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 ...

?!
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-7-7 18:09:02 | 显示全部楼层
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

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

十二年都不更新的库你要用来干嘛呢?这样的库有问题是在所难免的
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

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

https://fishc.com.cn/thread-230574-1-1.html
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

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

套娃?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-7-7 18:17:54 | 显示全部楼层
想知道小甲鱼最近在做啥?请访问 -> 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
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-7-7 18:28:42 | 显示全部楼层
分开安装试一试?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-7-7 21:43:10 | 显示全部楼层
仅适用于Windows上的Python2.6
我服了
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-13 22:21

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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