adrienverge / PhotoCollage

Graphical tool to make photo collage posters
GNU General Public License v2.0
426 stars 70 forks source link

Windows Installer #45

Open Ark74 opened 7 years ago

Ark74 commented 7 years ago

I'm not really familiar with python, but can PhotoCollage be compiled(?) as a binary for Windows. Can it be installed on Windows? Is there a way to achieve it? Could you point me on the right direction to understand more over this subject.

Thanks

adrienverge commented 7 years ago

Hi, sorry but I have no idea.

If you find a way to make it work on Windows, I'm curious to know to how.

sharmer156 commented 5 years ago

windows 10 error: Failed building wheel for photocollage when pip3 install photocollage

error report

 Running setup.py clean for photocollage
Failed to build photocollage
Installing collected packages: photocollage
  Running setup.py install for photocollage ... error
    Complete output from command c:\programdata\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\chz\\AppData\\Local\\Temp\\pip-install-9r0g8hn_\\photocollage\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\chz\AppData\Local\Temp\pip-record-uuw1zm9i\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib
    creating build\lib\photocollage
    copying photocollage\artwork.py -> build\lib\photocollage
    copying photocollage\collage.py -> build\lib\photocollage
    copying photocollage\gtkgui.py -> build\lib\photocollage
    copying photocollage\render.py -> build\lib\photocollage
    copying photocollage\__init__.py -> build\lib\photocollage
    running build_scripts
    creating build\scripts-3.6
    copying and adjusting bin\photocollage -> build\scripts-3.6
    running build_i18n
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\chz\AppData\Local\Temp\pip-install-9r0g8hn_\photocollage\setup.py", line 127, in <module>
        "six",
      File "c:\programdata\anaconda3\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\programdata\anaconda3\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "c:\programdata\anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\programdata\anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "c:\programdata\anaconda3\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "c:\programdata\anaconda3\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\programdata\anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\programdata\anaconda3\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "c:\programdata\anaconda3\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\programdata\anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\chz\AppData\Local\Temp\pip-install-9r0g8hn_\photocollage\setup.py", line 36, in run
        raise Exception("GNU gettext msgfmt utility not found! "
    Exception: GNU gettext msgfmt utility not found! It is needed to compile po files.
CrazyEoin commented 5 years ago

I've the exact same issue as sharmer156 on Windows 10. Any ideas?

adrienverge commented 5 years ago

Use Linux :+1:

Ark74 commented 5 years ago

I would suggest that too, being using GNU/Linux for the passed 12 years now :smiley: But for some folks in schools mainly who uses Windows, this tools would be of great use. Looks like it can be done, here some info: https://stackoverflow.com/questions/25381761/creating-an-installer-for-a-python-gtk3-application

Maybe later this month I can recheck or later. :calendar:

Markel commented 5 years ago

Or you could use a virtual machine 😄

realuser commented 2 years ago

I got photocollage working on Windows 10.

Initially I just tried pip install photocollage

This command finishes without error but then trying to run photocollage brings up the default Windows program chooser ("How do you want to open this file?") Choosing python does nothing.

Then I tried python -c "from photocollage import gtkgui; gtkgui.main()"

Which gave the error: ModuleNotFoundError: No module named 'cairo'

I installed pycairo tried again and got

ModuleNotFoundError: No module named 'gi'

So instead I decided to try Anaconda. I created a new environment

conda create --name pc
conda activate pc
conda install -c conda-forge pygobject gtk3 pillow

I still had to install photocollage via pip since doesn't seem to be a conda package for it. pip install photocollage

Trying just photocollage at the command line didn't work but then I tried python -c 'from photocollage import gtkgui; gtkgui.main()'

which gave yet another error:

  File "<string>", line 1
    'from
    ^
SyntaxError: unterminated string literal (detected at line 1)

I replaced the single quotes with double quotes:

python -c "from photocollage import gtkgui; gtkgui.main()"

And success! Got the photocollage gui to appear and seems to be working correctly.

kburchfiel commented 1 year ago

Thank you @realuser --this worked great for me also in Windows 10! I followed some similar steps within my miniforge Python environment:

pip install photocollage conda install pycairo conda install pygobject conda install gtk3

(I already had pillow loaded on my system.)

Then, as you recommended, I ran python -c "from photocollage import gtkgui; gtkgui.main()" and it loaded!