Frewacom / pywalfox

Dynamic theming of Firefox (and Thunderbird) using your Pywal colors
https://addons.mozilla.org/en-US/firefox/addon/pywalfox/
Mozilla Public License 2.0
583 stars 12 forks source link

The extension couldn't find the command in Mac #33

Closed egeesin closed 3 years ago

egeesin commented 4 years ago

Edit: It's kind of duplicate of #30.

Operating System: macOS 10.15.5 Web Browser: Firefox 77.0.1 Extension Version: 2.0.3 CLI Version: 24

Tried to install pywalfox by following README. Aside from main issue, pip install pywalfox threw:

ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pywalfox-2.4.dist-info'
Consider using the `--user` option or check the permissions.

But pip3.8 install pywalfox or sudo pip install pywalfox worked for me. I'm not really certain about either I'm using pip that installed from Homebrew or built-in system binary directory, but I tried both and repeated following steps.

After restarting Firefox with browser console, I saw this warning at the beginning:

stderr output from native app pywalfox: /usr/local/lib/python3.8/site-packages/pywalfox/bin/main.sh: line 3: pywalfox: command not found

Checked which pywalfox and I replaced pywalfox daemon with /usr/local/bin/pywalfox daemon, restart the browser and the extension fetched the colors successfully. What I couldn't understand fully, was pywalfox command not written with absolute path because it's supposed to executed from default path and my binary paths weren't configured right? Or is main.sh written without the thought that paths may differ on different distros/operating systems? Thanks in advance.

Frewacom commented 4 years ago

The permission error you got when running pip install pywalfox seems to be some issue with pip on your system (for python 2.7).

As for the command not found error, main.sh assumes that pywalfox is in your PATH. It does not use absolute paths.

Are you able to run pywalfox from the command line without specifying an absolute path?

egeesin commented 4 years ago

Are you able to run pywalfox from the command line without specifying an absolute path?

Yes, I can execute it in my main terminal emulator. Also:

~
❯ echo $PATH
/Users/ege/.yarn/bin:/Users/ege/.config/yarn/global/node_modules/.bin:/Users/ege/.zplug/bin:/Users/ege/.nvm/versions/node/v10.16.0/bin:/bin:/usr/local/opt/openssl/bin:/usr/local/opt/ncurses/bin:/usr/local/opt/bc/bin:/usr/local/opt/ruby/bin:/usr/local/sbin:/usr/sbin:/sbin:/Users/ege/.dots/bin:/usr/local/bin:/usr/bin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/ege/.rvm/bin

~
❯ which pywalfox
/usr/local/bin/pywalfox

~
❯ pywalfox -v
v2.4

$PATH is hard to read but /usr/local/bin is also included, even though browser console says command not found and not fetching colors.

Frewacom commented 4 years ago

Could it be that the PATH variable is set locally in your terminal emulator config, rather than globally (similarly to #30)?

Frewacom commented 3 years ago

As you said, this is a basically a duplicate of #34, so I will be closing this for now. Also, I have pushed an update to the native messaging application that should hopefully fix this.