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

Add requirements.txt #18

Merged
merged 1 commit into from
Jun 7, 2023
Merged

Add requirements.txt #18

merged 1 commit into from
Jun 7, 2023

Conversation

lukasjenks
Copy link
Contributor

@lukasjenks lukasjenks commented Jun 7, 2023

Simple PR to add a requirements.txt file. Was in a fresh python venv so this should be all of the required ones. I noticed this snippet in site-packages/matplotlib/backends/backend_gtk4.py:

try:
    import gi
except ImportError as err:
    raise ImportError("The GTK4 backends require PyGObject") from err

So while pygobject isn't required unless you're running on a GTK4 backend, the error produced when hit if it's missing sometimes doesn't help much without some digging, since it's triggered by the gi.require_version() call instead of the try/catch above if you have a different gi module installed. So may as well include pygobject in the requirements.txt file for GTK4 users.

  File "<python venv path>/python3.11/site-packages/matplotlib/backends/backend_gtk4agg.py", line 4, in <module>
    from . import backend_agg, backend_gtk4
  File "<python venv path>/python3.11/site-packages/matplotlib/backends/backend_gtk4.py", line 19, in <module>
    gi.require_version("Gtk", "4.0")
    ^^^^^^^^^^^^^^^^^^
AttributeError: module 'gi' has no attribute 'require_version'

(Error comes from site-packages/matplotlib/backends/backend_gtk4.py if running a UI based on GTK4 like me).

@braindotai braindotai merged commit c646ff7 into braindotai:master Jun 7, 2023
@braindotai
Copy link
Owner

Perfect ;)

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

Successfully merging this pull request may close these issues.

2 participants