coindicator icon indicating copy to clipboard operation
coindicator copied to clipboard

Installation on Debian 12 Bookworm issues

Open andyceo opened this issue 1 year ago • 4 comments

Hi there!

I tried to install your wonderful app on Debian 12 in Python virtual environment and finally success achieved )

I faced with issue that on Debian 12 you first need to install following system packages:

sudo apt install libcairo2-dev libgirepository1.0-dev gir1.2-ayatanaappindicator3-0.1

Then, you install the pip requirements as documnted: pip install -e .[develop]

And then, you have to make following source code changes (obtained with git diff):

diff --git a/src/coin/coin.py b/src/coin/coin.py
index c30a768..ed41aaa 100755
--- a/src/coin/coin.py
+++ b/src/coin/coin.py
@@ -12,7 +12,7 @@ import gi
 gi.require_version("Gtk", "3.0")
 gi.require_version("Gdk", "3.0")
 gi.require_version("GdkPixbuf", "2.0")
-gi.require_version("AppIndicator3", "0.1")
+gi.require_version("AyatanaAppIndicator3", "0.1")
 os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "hide"
 
 import importlib
@@ -32,7 +32,7 @@ from coin.coingecko_client import CoinGeckoClient
 from coin.config import Config
 
 try:
-    from gi.repository import AppIndicator3 as AppIndicator
+    from gi.repository import AyatanaAppIndicator3 as AppIndicator
 except ImportError:
     from gi.repository import AppIndicator
 
diff --git a/src/coin/indicator.py b/src/coin/indicator.py
index 13949de..d2b33d4 100644
--- a/src/coin/indicator.py
+++ b/src/coin/indicator.py
@@ -13,7 +13,7 @@ from coin.config import Config
 from coin.asset_selection import AssetSelectionWindow
 
 try:
-    from gi.repository import AppIndicator3 as AppIndicator
+    from gi.repository import AyatanaAppIndicator3 as AppIndicator
 except ImportError:
     from gi.repository import AppIndicator

Because for some reason, there is no AppIndicator3 namespace in Debian and one have to use AyatanaAppIndicator3. I am not specialist with Python GUI apps so I do not know how to make really usefull patch for it, so leaving it here "as-is" for your coincideration.

Thanks for app and have a good time!

PS: Some related link: https://lazka.github.io/pgi-docs/#AyatanaAppIndicator3-0.1

andyceo avatar Sep 05 '24 14:09 andyceo

hi Andrey, I appreciate the research you've done. These things indeed seem to depend on the distribution used. I guess I should adapt the install script to do different things on Debian than on Ubuntu. To test them all is a lot of work of course and these are busy days. I'll eventually either just update the README or the install script (although I accept patches for either :))

bluppfisk avatar Sep 05 '24 16:09 bluppfisk

Hi Andy, thank you for the solution you researched to get the app working on Debian Bookworm. I edited the two files you mentioned manually, replacing the corresponding lines from your git diff. When I manually start the app from the terminal with the environment set i get the following error(s):

Traceback (most recent call last): File "/opt/coindicator/venv/bin/coindicator", line 8, in sys.exit(main()) ^^^^^^ File "/opt/coindicator/venv/lib/python3.11/site-packages/coin/coin.py", line 356, in main Coin(config) File "/opt/coindicator/venv/lib/python3.11/site-packages/coin/coin.py", line 59, in init self._load_settings() File "/opt/coindicator/venv/lib/python3.11/site-packages/coin/coin.py", line 127, in _load_settings "asset_pair": self.assets[first_code][0].get("pair"), ~~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range

I couldn´t install the development files needed with the pip install -e .[develop] command, from which directory and/or environment do i need to issue the command, or did the install script already install these dependencies?

jitclub avatar Feb 11 '25 20:02 jitclub

Hy @jitclub ! My workflow is:

git clone [email protected]:bluppfisk/coindicator.git
cd coindicator
python3 -m venv venv
source venv/bin/activate
pip install -e .[develop]

Then ensure that you make fixes and start app:

coindicator

Try this and it should works I think.

andyceo avatar Feb 13 '25 12:02 andyceo

Hello Andy, thanks for your reply. When I try the git clone command, i get this error:

Cloning into 'coindicator'... The authenticity of host 'github.com (140.82.121.3)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. [email protected]: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

The other commands did work, when I started the application after fixing the corresponding lines replacing AppIndicator with AyatanaAppIndicator i still get the same error:

Traceback (most recent call last): File "/home/fafnir/bin/coindicator/venv/bin/coindicator", line 8, in sys.exit(main()) ^^^^^^ File "/home/fafnir/bin/coindicator/src/coin/coin.py", line 354, in main Coin(config) File "/home/fafnir/bin/coindicator/src/coin/coin.py", line 57, in init self._load_settings() File "/home/fafnir/bin/coindicator/src/coin/coin.py", line 125, in _load_settings "asset_pair": self.assets[first_code][0].get("pair"), ~~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range

jitclub avatar Feb 13 '25 22:02 jitclub