gpt4 book ai didi

Python - 'MSVCCompiler' 对象没有属性 'compiler'

转载 作者:行者123 更新时间:2023-12-01 08:55:09 25 4
gpt4 key购买 nike

我在 Windows 10 64 位系统上使用 Python 版本 3.7。

我正在尝试安装名为“PyGObject”的软件包,但无法执行此操作。我收到以下错误。

C:\Users\mukar>pip install PyGObject
Collecting PyGObject
Using cached https://files.pythonhosted.org/packages/00/17/198a9d0eb0e89b5c7d2a9b4437eb40d62702ab771030cd79fc7141cb0d30/PyGObject-3.30.1.tar.gz
Requirement already satisfied: pycairo>=1.11.1 in c:\users\mukar\appdata\local\programs\python\python37\lib\site-packages (from PyGObject) (1.17.1)
Installing collected packages: PyGObject
Running setup.py install for PyGObject ... error
Complete output from command c:\users\mukar\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\mukar\\AppData\\Local\\Temp\\pip-install-srfolyoj\\PyGObject\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\mukar\AppData\Local\Temp\pip-record-x4gbheju\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\pygtkcompat
copying pygtkcompat\generictreemodel.py -> build\lib.win-amd64-3.7\pygtkcompat
copying pygtkcompat\pygtkcompat.py -> build\lib.win-amd64-3.7\pygtkcompat
copying pygtkcompat\__init__.py -> build\lib.win-amd64-3.7\pygtkcompat
creating build\lib.win-amd64-3.7\gi
copying gi\docstring.py -> build\lib.win-amd64-3.7\gi
copying gi\importer.py -> build\lib.win-amd64-3.7\gi
copying gi\module.py -> build\lib.win-amd64-3.7\gi
copying gi\pygtkcompat.py -> build\lib.win-amd64-3.7\gi
copying gi\types.py -> build\lib.win-amd64-3.7\gi
copying gi\_compat.py -> build\lib.win-amd64-3.7\gi
copying gi\_constants.py -> build\lib.win-amd64-3.7\gi
copying gi\_error.py -> build\lib.win-amd64-3.7\gi
copying gi\_gtktemplate.py -> build\lib.win-amd64-3.7\gi
copying gi\_option.py -> build\lib.win-amd64-3.7\gi
copying gi\_ossighelper.py -> build\lib.win-amd64-3.7\gi
copying gi\_propertyhelper.py -> build\lib.win-amd64-3.7\gi
copying gi\_signalhelper.py -> build\lib.win-amd64-3.7\gi
copying gi\__init__.py -> build\lib.win-amd64-3.7\gi
creating build\lib.win-amd64-3.7\gi\repository
copying gi\repository\__init__.py -> build\lib.win-amd64-3.7\gi\repository
creating build\lib.win-amd64-3.7\gi\overrides
copying gi\overrides\Gdk.py -> build\lib.win-amd64-3.7\gi\overrides
copying gi\overrides\GdkPixbuf.py -> build\lib.win-amd64-3.7\gi\overrides
copying gi\overrides\GIMarshallingTests.py -> build\lib.win-amd64-3.7\gi\overrides
copying gi\overrides\Gio.py -> build\lib.win-amd64-3.7\gi\overrides
copying gi\overrides\GLib.py -> build\lib.win-amd64-3.7\gi\overrides
copying gi\overrides\GObject.py -> build\lib.win-amd64-3.7\gi\overrides
copying gi\overrides\Gtk.py -> build\lib.win-amd64-3.7\gi\overrides
copying gi\overrides\keysyms.py -> build\lib.win-amd64-3.7\gi\overrides
copying gi\overrides\Pango.py -> build\lib.win-amd64-3.7\gi\overrides
copying gi\overrides\__init__.py -> build\lib.win-amd64-3.7\gi\overrides
running build_ext
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\mukar\AppData\Local\Temp\pip-install-srfolyoj\PyGObject\setup.py", line 1189, in <module>
main()
File "C:\Users\mukar\AppData\Local\Temp\pip-install-srfolyoj\PyGObject\setup.py", line 1184, in main
zip_safe=False,
File "c:\users\mukar\appdata\local\programs\python\python37\lib\site-packages\setuptools\__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "c:\users\mukar\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\mukar\appdata\local\programs\python\python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\mukar\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\mukar\appdata\local\programs\python\python37\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\mukar\appdata\local\programs\python\python37\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\mukar\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\mukar\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\mukar\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\mukar\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\mukar\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\mukar\AppData\Local\Temp\pip-install-srfolyoj\PyGObject\setup.py", line 1024, in run
self._setup_extensions()
File "C:\Users\mukar\AppData\Local\Temp\pip-install-srfolyoj\PyGObject\setup.py", line 1010, in _setup_extensions
add_ext_compiler_flags(gi_ext, compiler)
File "C:\Users\mukar\AppData\Local\Temp\pip-install-srfolyoj\PyGObject\setup.py", line 881, in add_ext_compiler_flags
cache_key = compiler.compiler[0]
AttributeError: 'MSVCCompiler' object has no attribute 'compiler'

----------------------------------------
Command "c:\users\mukar\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\mukar\\AppData\\Local\\Temp\\pip-install-srfolyoj\\PyGObject\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\mukar\AppData\Local\Temp\pip-record-x4gbheju\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\mukar\AppData\Local\Temp\pip-install-srfolyoj\PyGObject\

我尝试到处搜索,但找不到任何解决方案。我什至尝试在 Python 3.4 和 2.7 版本上安装它,但仍然没有成功。我正在使用 PyCharm IDE。

任何帮助将不胜感激!

最佳答案

pygobject setup.py 中的一些额外构建代码似乎存在问题。查看提交历史记录版本 3.28.0 应该可以工作:

pip install pygobject==3.28.0

我创建了一个新问题:https://gitlab.gnome.org/GNOME/pygobject/issues/275

关于Python - 'MSVCCompiler' 对象没有属性 'compiler',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52816809/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com