Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

en/latest/windows #8

Open
utterances-bot opened this issue Jun 7, 2024 · 3 comments
Open

en/latest/windows #8

utterances-bot opened this issue Jun 7, 2024 · 3 comments

Comments

@utterances-bot
Copy link

Gaphor on Windows - Gaphor documentation

https://docs.gaphor.org/en/latest/windows.html

Copy link

xdcsGod commented Jun 7, 2024

我在windows环境下,安装poetry依赖的时候遇到错误:(貌似是这个包的问题pygobject (==3.48.2))

  • Installing pygobject (3.48.2): Failed

ChefBuildError

Backend subprocess exited when trying to invoke build_wheel

  • meson setup C:\Users\renyc-a\AppData\Local\Temp\tmpssz914ep\pygobject-3.48.2 C:\Users\renyc-a\AppData\Local\Temp\tmpssz914ep\pygobject-3.48.2.mesonpy-z64o_u0p -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dtests=false -Dwheel=true --wrap-mode=nofallback --native-file=C:\Users\renyc-a\AppData\Local\Temp\tmpssz914ep\pygobject-3.48.2.mesonpy-z64o_u0p\meson-python-native-file.ini
    The Meson build system
    Version: 1.4.1
    Source dir: C:\Users\renyc-a\AppData\Local\Temp\tmpssz914ep\pygobject-3.48.2
    Build dir: C:\Users\renyc-a\AppData\Local\Temp\tmpssz914ep\pygobject-3.48.2.mesonpy-z64o_u0p
    Build type: native build
    Project name: pygobject
    Project version: 3.48.2

..\meson.build:1:0: ERROR: Compiler cl cannot compile programs.

A full log can be found at C:\Users\renyc-a\AppData\Local\Temp\tmpssz914ep\pygobject-3.48.2.mesonpy-z64o_u0p\meson-logs\meson-log.txt

at ~\pipx\venvs\poetry\Lib\site-packages\poetry\installation\chef.py:164 in _prepare
160│
161│ error = ChefBuildError("\n\n".join(message_parts))
162│
163│ if error is not None:
→ 164│ raise error from None
165│
166│ return path
167│
168│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with pygobject (3.48.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pygobject (==3.48.2)"'.

我尝试单独去安装pygobject包,但是一直安装失败:
pip install PyGObject
Looking in indexes: https://mirrors.ustc.edu.cn/pypi/web/simple
Collecting PyGObject
Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/f9/9e/6bab1ed3bd878f0912d9a0600c21f3d88bab0e8a8d4c3ce50f5cf336faaf/pygobject-3.48.2.tar.gz (715 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
+ meson setup C:\Users\renyc-a\AppData\Local\Temp\pip-install-_p2p9d1m\pygobject_d5f18cb1ca204ec48b42172276f2e0ab C:\Users\renyc-a\AppData\Local\Temp\pip-install-_p2p9d1m\pygobject_d5f18cb1ca204ec48b42172276f2e0ab.mesonpy-f_y0dwpl -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dtests=false -Dwheel=true --wrap-mode=nofallback --native-file=C:\Users\renyc-a\AppData\Local\Temp\pip-install-_p2p9d1m\pygobject_d5f18cb1ca204ec48b42172276f2e0ab.mesonpy-f_y0dwpl\meson-python-native-file.ini
The Meson build system
Version: 1.4.1
Source dir: C:\Users\renyc-a\AppData\Local\Temp\pip-install-_p2p9d1m\pygobject_d5f18cb1ca204ec48b42172276f2e0ab
Build dir: C:\Users\renyc-a\AppData\Local\Temp\pip-install-_p2p9d1m\pygobject_d5f18cb1ca204ec48b42172276f2e0ab.mesonpy-f_y0dwpl
Build type: native build
Project name: pygobject
Project version: 3.48.2

  ..\meson.build:1:0: ERROR: Compiler cl cannot compile programs.

  A full log can be found at C:\Users\renyc-a\AppData\Local\Temp\pip-install-_p2p9d1m\pygobject_d5f18cb1ca204ec48b42172276f2e0ab\.mesonpy-f_y0dwpl\meson-logs\meson-log.txt
  [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

@amolenaar
Copy link
Member

Hi @xdcsGod,

Compiling on Windows is always more tricky that it's should have been. You're trying to compile everything directly from a Chef script?

I recommend you use GVSBuild (https://github.com/wingtk/gvsbuild), as it provide all fixes required to build on Windows.

Copy link

I tried to package on a Windows 11 x64 system, but during the installation process, it prompted me that pygoobject import was unsuccessful. I followed the steps in the documentation and reinstalled PyGOobject and pycairo using the GVSBuild wheel. The installation was successful, and the Poetry Run Poe package prompted me with No module named 'pyinstaller_version file'. The following is the error message

poetry show
alabaster 0.7.16 A light, configurable Sphinx theme
asttokens 2.4.1 Annotate AST trees with source code positions
attrs 23.2.0 Classes Without Boilerplate
babel 2.15.0 Internationalization utilities
babelgladeextractor 0.7.0 Babel l10n support for Glade, GtkBuilder, and .desktop files
better-exceptions 0.3.3 Pretty and helpful exceptions, automatically
certifi 2024.6.2 Python package for providing Mozilla's CA Bundle.
cfgv 3.4.0 Validate configuration and produce human readable error messages.
charset-normalizer 3.3.2 The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet.
colorama 0.4.6 Cross-platform colored terminal text.
coverage 7.5.3 Code coverage measurement for Python
decorator 5.1.1 Decorators for Humans
defusedxml 0.7.1 XML bomb protection for Python stdlib modules
distlib 0.3.8 Distribution utilities
docutils 0.21.2 Docutils -- Python Documentation Utilities
dulwich 0.22.1 Python Git Library
exceptiongroup 1.2.1 Backport of PEP 654 (exception groups)
executing 2.0.1 Get the currently executing AST node of a frame, and other information
filelock 3.14.0 A platform independent file lock.
gaphas 4.0.0 Gaphas is a GTK diagramming widget
generic 1.1.2 Generic programming library for Python
hypothesis 6.103.5 A library for property-based testing
identify 2.5.36 File identification library for Python
idna 3.7 Internationalized Domain Names in Applications (IDNA)
imagesize 1.4.1 Getting image size from png/jpeg/jpeg2000/gif file
iniconfig 2.0.0 brain-dead simple config-ini parsing
ipython 8.25.0 IPython: Productive Interactive Computing
jedi 0.19.1 An autocompletion tool for Python that can be used for text editors.
jinja2 3.1.4 A very fast and expressive template engine.
markupsafe 2.1.5 Safely add untrusted strings to HTML/XML markup.
matplotlib-inline 0.1.7 Inline Matplotlib backend for Jupyter
nodeenv 1.9.1 Node.js virtual environment builder
packaging 24.0 Core utilities for Python packages
parso 0.8.4 A Python Parser
pastel 0.2.1 Bring colors to your terminal.
pillow 10.3.0 Python Imaging Library (Fork)
platformdirs 4.2.2 A small Python package for determining appropriate platform-specific dirs, e.g. a user data dir.
pluggy 1.5.0 plugin and hook calling mechanisms for python
poethepoet 0.26.1 A task runner that works well with poetry.
pre-commit 3.7.1 A framework for managing and maintaining multi-language pre-commit hooks.
prompt-toolkit 3.0.46 Library for building powerful interactive command lines in Python
pure-eval 0.2.2 Safely evaluate AST nodes without side effects
pycairo 1.26.1 Python interface for cairo
pydot 2.0.0 Python interface to Graphviz's Dot
pygments 2.18.0 Pygments is a syntax highlighting package written in Python.
pygobject 3.48.2 Python bindings for GObject Introspection
pyparsing 3.1.2 pyparsing module - Classes and methods to define and execute parsing grammars
pytest 8.1.2 pytest: simple powerful testing with Python
pytest-archon 0.0.6 Rule your architecture like a real developer
pytest-cov 5.0.0 Pytest plugin for measuring coverage.
pytest-randomly 3.15.0 Pytest plugin to randomly order tests and control random.seed.
pyyaml 6.0.1 YAML parser and emitter for Python
requests 2.32.3 Python HTTP for Humans.
setuptools 70.0.0 Easily download, build, install, upgrade, and uninstall Python packages
six 1.16.0 Python 2 and 3 compatibility utilities
snowballstemmer 2.2.0 This package provides 29 stemmers for 28 languages generated from Snowball algorithms.
sortedcontainers 2.4.0 Sorted Containers -- Sorted List, Sorted Dict, Sorted Set
sphinx 7.3.7 Python documentation generator
sphinxcontrib-applehelp 1.0.8 sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books
sphinxcontrib-devhelp 1.0.6 sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp documents
sphinxcontrib-htmlhelp 2.0.5 sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files
sphinxcontrib-jsmath 1.0.1 A sphinx extension which renders display math in HTML via JavaScript
sphinxcontrib-qthelp 1.0.7 sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp documents
sphinxcontrib-serializinghtml 1.1.10 sphinxcontrib-serializinghtml is a sphinx extension which outputs "serialized" HTML files (json and pickle)
stack-data 0.6.3 Extract data from python stack frames and tracebacks for informative displays
tinycss2 1.3.0 A tiny CSS parser
tomli 2.0.1 A lil' TOML parser
traitlets 5.14.3 Traitlets Python configuration system
urllib3 2.2.2 HTTP library with thread-safe connection pooling, file post, and more.
virtualenv 20.26.2 Virtual Python Environment builder
wcwidth 0.2.13 Measures the displayed width of unicode strings in a terminal
webencodings 0.5.1 Character encoding aliases for legacy web content
xdoctest 1.1.5 A rewrite of the builtin doctest module
(venv) PS D:\project-python\gaphor> poetry install --only main,packaging,automation
Installing dependencies from lock file

Package operations: 1 install, 1 update, 0 removals

  • Updating pygobject (3.48.2 C:/gtk/wheels/pygobject-3.48.2-cp312-cp312-win_amd64.whl -> 3.48.2): Failed

ChefBuildError

Backend subprocess exited when trying to invoke build_wheel

  • meson setup C:\Users\admin\AppData\Local\Temp\tmpkrozbxqd\pygobject-3.48.2 C:\Users\admin\AppData\Local\Temp\tmpkrozbxqd\pygobject-3.48.2.mesonpy-3o4jyuq4 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dtests=false -Dwheel=true --wrap-mode=nofallback --native-file=C:\Users\admin\AppData\Local\Temp\tmpkrozbxqd\pygobject-3.48.2.mesonpy-3o4jyuq4\meson-python-native-file.ini
    The Meson build system
    Version: 1.4.1
    Source dir: C:\Users\admin\AppData\Local\Temp\tmpkrozbxqd\pygobject-3.48.2
    Build dir: C:\Users\admin\AppData\Local\Temp\tmpkrozbxqd\pygobject-3.48.2.mesonpy-3o4jyuq4
    Build type: native build
    Project name: pygobject
    Project version: 3.48.2
    C compiler for the host machine: gcc (gcc 10.3.0 "gcc (tdm-1) 10.3.0")
    C linker for the host machine: gcc ld.bfd 2.32
    Host machine cpu family: x86
    Host machine cpu: x86
    Program python3 found: YES (C:\Users\admin\AppData\Local\Temp\tmp0uxw7if_.venv\Scripts\python.exe)
    Need python for x86, but found x86_64
    Run-time dependency python found: NO (tried sysconfig)

..\meson.build:22:20: ERROR: Python dependency not found

A full log can be found at C:\Users\admin\AppData\Local\Temp\tmpkrozbxqd\pygobject-3.48.2.mesonpy-3o4jyuq4\meson-logs\meson-log.txt

at ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\poetry\installation\chef.py:164 in _prepare
160│
161│ error = ChefBuildError("\n\n".join(message_parts))
162│
163│ if error is not None:
→ 164│ raise error from None
165│
166│ return path
167│
168│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with pygobject (3.48.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pygobject (==3.48.2)"'.

(venv) PS D:\project-python\gaphor> poetry run pip install --force-reinstall (Resolve-Path C:\gtk\wheels\PyGObject*.whl)
Processing c:\gtk\wheels\pygobject-3.48.2-cp312-cp312-win_amd64.whl
Collecting pycairo>=1.16 (from pygobject==3.48.2)
Using cached pycairo-1.26.1-cp312-cp312-win_amd64.whl.metadata (2.8 kB)
Using cached pycairo-1.26.1-cp312-cp312-win_amd64.whl (862 kB)
Installing collected packages: pycairo, pygobject
Attempting uninstall: pycairo
Found existing installation: pycairo 1.26.1
Uninstalling pycairo-1.26.1:
Successfully uninstalled pycairo-1.26.1
Attempting uninstall: pygobject
Found existing installation: PyGObject 3.48.2
Uninstalling PyGObject-3.48.2:
Successfully uninstalled PyGObject-3.48.2
Successfully installed pycairo-1.26.1 pygobject-3.48.2

[notice] A new release of pip is available: 24.0 -> 24.1
[notice] To update, run: python.exe -m pip install --upgrade pip
(venv) PS D:\project-python\gaphor> poetry run pip install --force-reinstall (Resolve-Path C:\gtk\wheels\pycairo*.whl)
Processing c:\gtk\wheels\pycairo-1.26.0-cp312-cp312-win_amd64.whl
Installing collected packages: pycairo
Attempting uninstall: pycairo
Found existing installation: pycairo 1.26.1
Uninstalling pycairo-1.26.1:
Successfully uninstalled pycairo-1.26.1
Successfully installed pycairo-1.26.0

[notice] A new release of pip is available: 24.0 -> 24.1
[notice] To update, run: python.exe -m pip install --upgrade pip
(venv) PS D:\project-python\gaphor> poetry build
Building gaphor (2.25.1)

  • Building sdist
  • Built gaphor-2.25.1.tar.gz
  • Building wheel
  • Built gaphor-2.25.1-py3-none-any.whl
    (venv) PS D:\project-python\gaphor> poetry run poe package
    Poe => pyinstaller -y gaphor.spec
    490 INFO: PyInstaller: 6.8.0, contrib hooks: 2024.7
    490 INFO: Python: 3.12.3
    530 INFO: Platform: Windows-11-10.0.22631-SP0
    530 INFO: Python environment: C:\Users\admin\AppData\Local\Programs\Python\Python312
    Traceback (most recent call last):
    File "", line 198, in run_module_as_main
    File "", line 88, in run_code
    File "C:\Users\admin\AppData\Local\Programs\Python\Python312\Scripts\pyinstaller.exe_main
    .py", line 7, in
    File "C:\Users\admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller_main
    .py", line 231, in console_script_run
    run()
    File "C:\Users\admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller_main
    .py", line 215, in run
    run_build(pyi_config, spec_file, **vars(args))
    File "C:\Users\admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller_main_.py", line 70, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
    File "C:\Users\admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\building\build_main.py", line 1216, in main
    build(specfile, distpath, workpath, clean_build)
    File "C:\Users\admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyInstaller\building\build_main.py", line 1156, in build
    exec(code, spec_namespace)
    File "gaphor.spec", line 6, in
    import pyinstaller_versionfile
    ModuleNotFoundError: No module named 'pyinstaller_versionfile'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants