gaphor / gaphas

Gaphas is the diagramming widget library for Python.
https://gaphas.readthedocs.io
164 stars 21 forks source link

Seems that the requirement for the gaphas package is not correct #773

Closed Jeff006 closed 6 months ago

Jeff006 commented 6 months ago

To Reproduce I just followed the described installation steps for Python:

pip install gaphor
gaphor

Expected behavior I ended up having gaphas 3.8.3:

pip3 install gaphas
Requirement already satisfied: gaphas in /home/jf/Desktop/SW/venv_graphor/lib/python3.8/site-packages (3.8.3)
Requirement already satisfied: pycairo<2.0.0,>=1.20.0 in /home/jf/Desktop/SW/venv_graphor/lib/python3.8/site-packages (from gaphas) (1.26.0)
Requirement already satisfied: PyGObject<4.0.0,>=3.38.0 in /home/jf/Desktop/SW/venv_graphor/lib/python3.8/site-packages (from gaphas) (3.46.0)

Then, when running gaphor I got the following error:

  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/jf/Desktop/SW/venv_graphor/lib/python3.8/site-packages/gaphor/plugins/diagramexport/__init__.py", line 13, in <module>
    from gaphor.diagram.painter import ItemPainter
  File "/home/jf/Desktop/SW/venv_graphor/lib/python3.8/site-packages/gaphor/diagram/painter.py", line 16, in <module>
    from gaphor.diagram.selection import Selection
  File "/home/jf/Desktop/SW/venv_graphor/lib/python3.8/site-packages/gaphor/diagram/selection.py", line 4, in <module>
    from gaphas.view.selection import Selection as _Selection
ModuleNotFoundError: No module named 'gaphas.view.selection'

Then, I tried to get an older version of gaphas and installed the oldest satisfying the requirement: 3.1.0 (gaphor 2.5.1 has requirement gaphas<4.0.0,>=3.1.0)

pip3 install gaphas==3.1.0

Now it seems that gaphor is working. I haven't played with it but at least it launches.

OS

NOTES:

Version Version of Gaphas: 3.8.0

danyeaw commented 6 months ago

Hi @Jeff006, to pip install gaphor, you need to be using Python 3.11 or 3.12. I doubt that you'll be able to successful get a development environment setup with Ubuntu 18.04 that version is 6 years old and is past end-of-life. We depend on very recent versions of GTK and related libraries. The full instructions on how to get a development environment setup are here: https://docs.gaphor.org/en/latest/linux.html#a-local-environment

amolenaar commented 6 months ago

@Jeff006 Additionally, we should probably increase the minimum Gaphas version from Gaphor.

You can always do pip install -U to upgrade dependencies to the latest (required) version.

Jeff006 commented 6 months ago

I didn't want a development environment but only an executable version. At the end, I gave up using pip. I had an install that launched but then saving a document failed and also the interface was not looking like the last one. I just used flatpak instead and it worked. The interface is the same as in the tutorial which was not the case with pip. However, I'm interested by the Sphinx integration so I will have to pip at some point 😄