歌者文明清理员 发表于 2023-7-7 18:05:42

pip install error!

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
╰─>
      ERROR: Could not import dsextras module: Make sure you have installed pygobject.
      

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
╰─>
      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/
      

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
有什么替代方法吗

陶远航 发表于 2023-7-7 18:06:18

It seems like you are trying to installwxPythonandPyGTKon Windows. To resolve the issues you're encountering, please follow these steps:

1. Install the (https://visualstudio.microsoft.com/visual-cpp-build-tools/). This step is required because the installation process for some packages, likepygobject , 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 pycairo
pip install pygobject


3. Now that you have installed the required dependencies, you can proceed with the installation ofwxPythonandPyGTK :

pip install wxPython
pip install pygtk


Please note thatPyGTKis an old and deprecated library. If possible, consider usingGtkfromgi.repository(which is provided by thepygobjectpackage you installed earlier) for new projects.

歌者文明清理员 发表于 2023-7-7 18:07:29

陶远航 发表于 2023-7-7 18:06
It seems like you are trying to installwxPythonandPyGTKon Windows. To resolve the issues you ...

?!

陶远航 发表于 2023-7-7 18:09:02

歌者文明清理员 发表于 2023-7-7 18:07
?!

GPT:我擅长说英语{:10_256:}

isdkz 发表于 2023-7-7 18:10:36



十二年都不更新的库你要用来干嘛呢?这样的库有问题是在所难免的

歌者文明清理员 发表于 2023-7-7 18:13:39

isdkz 发表于 2023-7-7 18:10
十二年都不更新的库你要用来干嘛呢?这样的库有问题是在所难免的

https://fishc.com.cn/thread-230574-1-1.html

isdkz 发表于 2023-7-7 18:16:15

歌者文明清理员 发表于 2023-7-7 18:13
https://fishc.com.cn/thread-230574-1-1.html

套娃?

歌者文明清理员 发表于 2023-7-7 18:17:54

isdkz 发表于 2023-7-7 18:16
套娃?

https://fishc.com.cn/thread-230566-1-1.html

isdkz 发表于 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/152881/answer-d1c70321-c70d-40a0-9ba0-bc02dede0194

sfqxx 发表于 2023-7-7 18:28:42

分开安装试一试?

liuhongrun2022 发表于 2023-7-7 21:43:10

仅适用于Windows上的Python2.6
我服了
页: [1]
查看完整版本: pip install error!