eoyilmaz / displaycal-py3

DisplayCAL Modernization Project
https://eoyilmaz.github.io/displaycal-py3/
GNU General Public License v3.0
773 stars 56 forks source link

Using pipx to install leads to path errors #318

Closed boboli closed 6 months ago

boboli commented 7 months ago

I successfully built the wheel for version 3.9.11, and then installed it with pipx (like pip, but it installs each wheel into its own isolated virtualenv). When I run displaycal, I get an error about not finding language files:

Warning: No language files found. The following places have been searched:
/home/photolaundry/.local/share/DisplayCAL/lang
/home/photolaundry/.local/share/pipx/venvs/displaycal/lib/python3.10/site-packages/DisplayCAL/lang
/home/photolaundry/.local/share/pipx/venvs/displaycal/lib/python3.10/site-packages/share/DisplayCAL/lang
/home/photolaundry/.local/share/DisplayCAL/lang
/usr/share/ubuntu/DisplayCAL/lang
/usr/local/share/DisplayCAL/lang
/usr/share/DisplayCAL/lang
/var/lib/snapd/desktop/DisplayCAL/lang
/var/lib/DisplayCAL/lang
/usr/share/ubuntu/doc/DisplayCAL-3.9.10/lang
/usr/local/share/doc/DisplayCAL-3.9.10/lang
/usr/share/doc/DisplayCAL-3.9.10/lang
/var/lib/snapd/desktop/doc/DisplayCAL-3.9.10/lang
/var/lib/doc/DisplayCAL-3.9.10/lang
/home/photolaundry/.local/share/doc/DisplayCAL-3.9.10/lang
/usr/share/ubuntu/doc/packages/DisplayCAL/lang
/usr/local/share/doc/packages/DisplayCAL/lang
/usr/share/doc/packages/DisplayCAL/lang
/var/lib/snapd/desktop/doc/packages/DisplayCAL/lang
/var/lib/doc/packages/DisplayCAL/lang
/home/photolaundry/.local/share/doc/packages/DisplayCAL/lang
/usr/share/ubuntu/doc/DisplayCAL/lang
/usr/local/share/doc/DisplayCAL/lang
/usr/share/doc/DisplayCAL/lang
/var/lib/snapd/desktop/doc/DisplayCAL/lang
/var/lib/doc/DisplayCAL/lang
/home/photolaundry/.local/share/doc/DisplayCAL/lang
/usr/share/ubuntu/doc/displaycal/lang
/usr/local/share/doc/displaycal/lang
/usr/share/doc/displaycal/lang
/var/lib/snapd/desktop/doc/displaycal/lang
/var/lib/doc/displaycal/lang
/home/photolaundry/.local/share/doc/displaycal/lang
/usr/share/ubuntu/icons/hicolor/lang
/usr/local/share/icons/hicolor/lang
/usr/share/icons/hicolor/lang
/var/lib/snapd/desktop/icons/hicolor/lang
/var/lib/icons/hicolor/lang
/home/photolaundry/.local/share/icons/hicolor/lang

Poking around a bit, I found that pipx installed these share/ files at ~/.local/share/pipx/venvs/displaycal/share/ rather than just ~/.local/share/. After I create a symlink at ~/.local/share displaycal runs perfectly. It seems like the search paths need to be broadened a bit to work with pipx.

I'm on Ubuntu 22.04.3 64-bit if it matters.

eoyilmaz commented 6 months ago

Hi I updated the data dirs search path, but I'm not sure if you'll be able to test it.

Normally I would say run the following (but before, remove your previous DisplayCAL installation from pipx, I don't know how btw):

git clone https://github.com/eoyilmaz/displaycal-py3
cd displaycal-py3
git checkout 318-using-pipx-to-install-leads-to-path-errors
python -m virtualenv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m build
pipx install dist/DisplayCAL-3.9.*.whl

and try running displaycal... and it should find the language files... at least I'm hopping that it would...

eoyilmaz commented 6 months ago

This is merged to the develop branch so the above commands will not work, instead run the following:

git clone https://github.com/eoyilmaz/displaycal-py3
cd displaycal-py3
git checkout develop
make venv
make build
pipx install dist/DisplayCAL-3.9.*.whl
boboli commented 6 months ago

I just tested it on both the develop branch as well as the latest 3.9.12 tag/release, and it works now. Thanks!

eoyilmaz commented 6 months ago

Cool, closing this issue then 👍