9

Over the last few days of headaches, I've found 3 possible methods to do this, all of which have issues.

  • PyGObject's pip install fails due to a lack of Cairo and probably other dependencies. While this would be my preferred method, it would probably be the hardest to fulfill.

  • Using MSYS2 allows me to use GObject through the mingw64 python, but using pip to get my other modulues such as pylint fails. I'd like to have an MSYS2 or similar install on my system anyways to make some windows binaries, so I'm very open to this as well.

    • EDIT: Got pip to work in MSYS2. Make sure to sync toolchain with pacman.
  • PyGObject for Windows seems messy at best and isn't up-to-date. Would require having a second python installation anyways, giving no benefit over MSYS2.

Note I'm a complete newbie to Unix and have little experience with CLI's in general, so any help regarding MSYS2 will need to be explained as if to a child. My only other experience with this stuff involved an endless cycle of hell that was installing Arch to a separate partition, breaking said install, then reinstalling again.

I also tried Cygwin, but I couldn't get that to run Python with GObject at all with my "install all the needed packages then pray" method. Creating a Gtk.Window() caused the terminal to use none of the memory it had and explode.

FierySwordswoman
  • 181
  • 1
  • 2
  • 7
  • Take a look at this article https://blogs.gnome.org/kittykat/2014/01/29/developing-gtk-3-apps-with-python-on-windows/ It explains how to install PyGObject, it works for me... – alvaropg Jan 12 '18 at 08:03

2 Answers2

6

MSYS2 is currently the only "officially" supported way: https://pygobject.readthedocs.io/en/latest/getting_started.html#windows

pip in MSYS2 should work in general, if something doesn't please file a bug at https://github.com/Alexpux/MINGW-packages/issues .

lazka
  • 683
  • 6
  • 7
  • I've tried my best to replicate what Quodlibet has achieved for Windows, but it seems a road full of traps. We really need a functional and replicable pipeline, i.e., from a .py to an installer that installs a software package with native executables. – kakyo Oct 21 '19 at 02:26
0

As you said in the third alternative to install a new Python version, you can create and run multiple Python versions using pyenv. You can go through the installation section of their Github repo for installation and an overview: https://github.com/pyenv/pyenv/

For a comprehensive guide on how to use it, you read this amazing post by Real Python: https://realpython.com/intro-to-pyenv/

tripleee
  • 175,061
  • 34
  • 275
  • 318
Abdul Rehman
  • 301
  • 2
  • 7