4

Edited for posterity: I got it to work. In my case, I had to use the --user option in pip. pip uninstalled pympress and then

python3 -m pip install --user pympress

OP continues below:

I'm trying to install Pympress, a LaTeX Beamer slideshow viewer on MacOS High Sierra. I've been wrestling with this install for a couple days now with various issues. I think I'm getting close, with everything finally settled on my Python 3.7 build. However, I'm hung up on the Gtk dependency.

Having installed all the dependencies (as far as I can tell, including things that I think aren't well-described on that Github page), I go to run the program with

pympress my_slides.pdf

and get the ValueError in the traceback below:

Traceback (most recent call last):

File "/Library/Frameworks/Python.framework/Versions/3.7/bin/pympress", line 7, in <module>
    from pympress.__main__ import main
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site- 
packages/pympress/__main__.py", line 41, in <module>
    from pympress import util
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pympress/util.py", line 36, in <module>
    gi.require_version('Gtk', '3.0')
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available

It just doesn't seem to have installed the gtk3 namespace in the proper place (and I don't know where it is at the moment, if at all), and I'm at a loss as to how to do so manually, if possible. The closest I've heard is installing gir1.2-gtk-3.0, but as far as I can tell that's a Linux need only, and neither brew or pip find it (same issue as this post).

Following the minimum working program on the PyGObject site site (another low-level dependency), I have the same namespace error. I've installed using their instructions as well, written their hello.py file and it doesn't run, with the same issue.

Have I missed a dependency somewhere? I've both followed the Pympress dependency install directions to the letter, as well as restarting and installing everything various ways independently using brew, which itself doesn't show any broken links.

Edit: it seems that manually compiling gtk and its dependencies, not going through brew, solved this namespace problem. That said, the package is also dependent on Poppler, which is now giving me the same error, just farther along in the code. Manually compiling this time hasn't seemed to work. I'll leave this up for posterity (and in case anyone has thoughts), but my current "workaround" is just going to be booting into Windows for the program, as binary installers are available.

Brandon
  • 41
  • 4

0 Answers0