nwg-piotr/azote

No such file or directory

Closed this issue · 2 comments

Describe the bug
The script fails to correctly identify the 'purelib' path when using pyenv. The python3 command points to a pyenv shim, leading to an incorrect 'purelib' path.

To Reproduce
Steps to reproduce the behavior:

$ azote
/usr/bin/azote: line 6: cd: /home/xyz/.pyenv/versions/3.12.0/lib/python3.12/site-packages/azote: No such file or directory
/usr/bin/python3: can't open file '/home/xyz/main.py': [Errno 2] No such file or directory

Expected behavior
azote to run as normal.
I modified the script as follows, it runs.

#!/bin/sh

if command -v pyenv > /dev/null 2>&1; then
    LIB=$(env -i /usr/bin/python3 -c "from sysconfig import get_path; print(get_path('purelib'))")
else
    LIB=$(python3 -Ic "from sysconfig import get_path; print(get_path('purelib'))")
fi

cd $LIB/azote
exec /usr/bin/python3 main.py "$@"

Desktop (please complete the following information):

  • Arch
  • WM: [sway]

Azote version (please state it clearly if you use -git version):

$ pacman -Qi azote
Name            : azote
Version         : 1.12.7-1

Ran across the same issue on my end on Fedora. After digging around, it looks like azote installed to /usr/lib/python3.12/site-packages/azote instead of /usr/local/lib/python3.12/site-packages/azote for me which makes this fail since it doesn't find the required folder. To fix it I just created a symlink for azote so it can be found appropriately. There's a few ways to dig through and find the actual azote folder location so I won't comment on that here but if you're not sure how to do this, a simple google search will help with this.

Not sure if this is the correct solution, but it worked for me! Your mileage may vary and your symlink paths will probably differ slightly based on your error but you could just find the correct path and link the same way as a temporary fix.

# general example
sudl ln -s /path/to/installed/location/azote /path/to/expected/location/azote

# fedora personal temporary fix example
sudo ln -s /usr/lib/python3.12/site-packages/azote /usr/local/lib/python3.12/site-packages/azote

Should be fixed in v1.12.8. Please reopen in case I'm wrong.