Kilian / Trimage

A cross-platform tool for optimizing PNG and JPG files.
http://trimage.org
MIT License
706 stars 55 forks source link

Local build (home directory) fails to start on current NixOS #92

Open hypatia-of-sva opened 1 year ago

hypatia-of-sva commented 1 year ago

Hello trimage team,

since there is no current package for NixOS, I tried to install Trimage locally to my home directory. This build however failed to start, so I share my experience here in hopes of someone knowing what I did wrong, or in explaining how else I could go about a manual installation:

I first made sure to install all dependencies; this is part of my configuration.nix package list:

 # image resize for website
     imagemagick
     pngcrush
     image_optim
     jpegoptim
     optipng
     advancecomp
# other trimage dependencies
     python311
     python311Packages.pyqt5

(the packges were the most obvious matches on https://search.nixos.org/packages?channel=23.05&show=python311Packages.pyqt5&from=0&size=50&sort=relevance&type=packages&query=python+qt5, for example)

I then ran the following commands to start a local copy:

git clone https://github.com/Kilian/Trimage
cd Trimage/
python setup.py build
cd bin
chmod +x ./trimage
./trimage

The installation also gave no error massages, apart from the distutils warning for python 3.12

On the last step, I got the following error:

Traceback (most recent call last):
  File "/home/sva/git/Trimage/bin/./trimage", line 19, in <module>
    import trimage
ModuleNotFoundError: No module named 'trimage'

Is this the expected behaviour, or did I do something wrong? If it is expected, is there a different way to run it locally (from a path in the home directory, to not mangle with the NixOS root (which gave an error on the usual install command listed on the Readme))?

with regards, Hypatia of Sva