Problème installation Silkaj à partir de AUR ArchLinux/pip

Salut,

J’ai installé silkaj via aur.archlinux.org.

Quand je lance silkaj, j’ai le message d’erreur suivant:

silkaj info
Traceback (most recent call last):
  File "/usr/bin/silkaj", line 33, in <module>
    sys.exit(load_entry_point('silkaj==0.8.0', 'console_scripts', 'silkaj')())
  File "/usr/bin/silkaj", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/silkaj/cli.py", line 22, in <module>
    from silkaj.tx import send_transaction
  File "/usr/lib/python3.9/site-packages/silkaj/tx.py", line 25, in <module>
    from silkaj.network_tools import ClientInstance
  File "/usr/lib/python3.9/site-packages/silkaj/network_tools.py", line 24, in <module>
    from duniterpy.api.client import Client
  File "/usr/lib/python3.9/site-packages/duniterpy/__init__.py", line 22, in <module>
    from . import api, documents, key
  File "/usr/lib/python3.9/site-packages/duniterpy/documents/__init__.py", line 34, in <module>
    from .crc_pubkey import CRCPubkey
  File "/usr/lib/python3.9/site-packages/duniterpy/documents/crc_pubkey.py", line 20, in <module>
    import base58
ModuleNotFoundError: No module named 'base58'

Il faut installer base58 :

sudo pip install base58

ou

pip install base58 --user

Peut-être vaut-il mieux installer silkaj via pip que via l’AUR : (dans ce cas-là la commande ci-dessus n’est normalement pas nécessaire)

sudo pip install silkaj

Merci.

Du coup j’ai l’erreur suivante:

silkaj -h
Traceback (most recent call last):
  File "/usr/bin/silkaj", line 33, in <module>
    sys.exit(load_entry_point('silkaj==0.8.0', 'console_scripts', 'silkaj')())
  File "/usr/bin/silkaj", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/silkaj/cli.py", line 22, in <module>
    from silkaj.tx import send_transaction
  File "/usr/lib/python3.9/site-packages/silkaj/tx.py", line 25, in <module>
    from silkaj.network_tools import ClientInstance
  File "/usr/lib/python3.9/site-packages/silkaj/network_tools.py", line 24, in <module>
    from duniterpy.api.client import Client
  File "/usr/lib/python3.9/site-packages/duniterpy/__init__.py", line 22, in <module>
    from . import api, documents, key
  File "/usr/lib/python3.9/site-packages/duniterpy/key/__init__.py", line 18, in <module>
    from .signing_key import SigningKey
  File "/usr/lib/python3.9/site-packages/duniterpy/key/signing_key.py", line 23, in <module>
    import pyaes
ModuleNotFoundError: No module named 'pyaes'

Je vais installer pyaes

Edit: il fallait encore installer avec sudo pip install: jsonschema et pendulum

J’ai désinstallé silkaj via pacman.

Puis installé avec sudo pip install

Ça déconne à l’installation:

Requirement already satisfied: chardet<4.0,>=2.0 in /usr/lib/python3.9/site-packages (from aiohttp<4.0.0,>=3.6.1->duniterpy==0.58.1->silkaj) (3.0.4)
Collecting typing-extensions>=3.6.5
  Downloading typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Collecting async-timeout<4.0,>=3.0
  Downloading async_timeout-3.0.1-py3-none-any.whl (8.2 kB)
Requirement already satisfied: pycparser in /usr/lib/python3.9/site-packages (from cffi>=1.4.1->PyNaCl<2.0,>=1.3->silkaj) (2.20)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3.9/site-packages (from yarl<2.0,>=1.0->aiohttp<4.0.0,>=3.6.1->duniterpy==0.58.1->silkaj) (2.10)
Using legacy 'setup.py install' for pypeg2, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pylibscrypt, since package 'wheel' is not installed.
Installing collected packages: attrs, libnacl, pypeg2, pylibscrypt, multidict, yarl, typing-extensions, async-timeout, aiohttp, duniterpy, texttable, ipaddress, tabulate, PyNaCl, silkaj
  Attempting uninstall: attrs
    Found existing installation: attrs 20.3.0
    Uninstalling attrs-20.3.0:
      Successfully uninstalled attrs-20.3.0
    Running setup.py install for pypeg2 ... done
    Running setup.py install for pylibscrypt ... done
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

ueberzug 18.1.7 requires pillow, which is not installed.
Successfully installed PyNaCl-1.4.0 aiohttp-3.7.3 async-timeout-3.0.1 attrs-19.3.0 duniterpy-0.58.1 ipaddress-1.0.23 libnacl-1.7.2 multidict-5.1.0 pylibscrypt-1.8.0 pypeg2-2.15.2 silkaj-0.8.1 tabulate-0.8.7 texttable-1.6.3 typing-extensions-3.7.4.3 yarl-1.6.3

Ensuite, ça merde à l’utilisation:

silkaj argos
Traceback (most recent call last):
  File "/usr/bin/silkaj", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/silkaj/tools.py", line 53, in wrapper
    return loop.run_until_complete(f(*args, **kwargs))
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/lib/python3.9/site-packages/silkaj/commands.py", line 235, in argos_info
    head_block = await HeadBlock().head_block
  File "/usr/lib/python3.9/site-packages/silkaj/blockchain_tools.py", line 51, in get_head
    return await client(blockchain.current)
  File "/usr/lib/python3.9/site-packages/duniterpy/api/bma/blockchain.py", line 270, in current
    return await client.get(MODULE + "/current", schema=BLOCK_SCHEMA)
  File "/usr/lib/python3.9/site-packages/duniterpy/api/client.py", line 362, in get
    response = await client.requests_get(url_path, **params)
  File "/usr/lib/python3.9/site-packages/duniterpy/api/client.py", line 238, in requests_get
    response = await self.connection_handler.session.get(
  File "/usr/lib/python3.9/site-packages/aiohttp/client.py", line 619, in _request
    break
  File "/usr/lib/python3.9/site-packages/aiohttp/helpers.py", line 656, in __exit__
    raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f6dee777190>

Le paquet AUR ne doit pas définir les dépendances à installer. Faut pas oublier que AUR est un dépôt communautaire. Le problème a déjà été rencontré :

Du coup le temps que le packaging AUR soit fonctionnel, il est possible d’installer via pip.

Attention de ne pas installer en root, sinon ça écrase les paquets de la distribution, comme, par exemple :

Donc, désinstalle, puis réinstalle pour l’utilisateur Unix :

(sudo) pip uninstall silkaj
pip install --user silkaj

L’installation semble être ok :

Cette erreur ne devrait pas être problématique, ça devrait être un warning :

Pour l’erreur de timeout, essaye avec un autre nœud :

silkaj -p duniter.moul.re info
silkaj -gt info

Peut-être qu’une installation pour l’utilisateur Unix corrigera le problème. Problème peut-être similaire.

J’ai désinstallé silkaj en faisant sudo pip uninstall, en l’installant pour l’utilisateur comme indiqué, puis en utilisant un autre noeud comme indiqué.

La commande info avec un autre noeud donne:

silkaj -p duniter.moul.re info
Connected to node: duniter.moul.re 443 
Current block number: 382253                                                                                                                                                        
Currency name: Ğ1                                                                                                                                                                   
Number of members: 2871                                                                                                                                                             
Minimal Proof-of-Work: 109                                                                                                                                                          
Current time: 2020-12-16 12:50:28                                                                                                                                                   
Median time: 2020-12-16 11:23:11                                                                                                                                                    
Difference time: 02:27:17 

La deuxième commande donne:

silkaj -gt info                                                                                                                                                   
Traceback (most recent call last):                                                                                                                                                  
  File "/home/daniel/.local/bin/silkaj", line 8, in <module>                                                                                                                        
    sys.exit(cli())                                                                                                                                                                 
  File "/usr/lib/python3.9/site-packages/click/core.py", line 829, in __call__                                                                                                      
    return self.main(*args, **kwargs)                                                                                                                                               
  File "/usr/lib/python3.9/site-packages/click/core.py", line 782, in main                                                                                                          
    rv = self.invoke(ctx)                                                                                                                                                           
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1259, in invoke                                                                                                       
    return _process_result(sub_ctx.command.invoke(sub_ctx))                                                                                                                         
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1066, in invoke                                                                                                       
    return ctx.invoke(self.callback, **ctx.params)                                                                                                                                  
  File "/usr/lib/python3.9/site-packages/click/core.py", line 610, in invoke                                                                                                        
    return callback(*args, **kwargs)                                                                                                                                                
  File "/home/daniel/.local/lib/python3.9/site-packages/silkaj/tools.py", line 53, in wrapper                                                                                       
    return loop.run_until_complete(f(*args, **kwargs))                                                                                                                              
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete                                                                                                 
    return future.result()                                                                                                                                                          
  File "/home/daniel/.local/lib/python3.9/site-packages/silkaj/commands.py", line 46, in currency_info                                                                              
    head_block = await HeadBlock().head_block                                                                                                                                       
  File "/home/daniel/.local/lib/python3.9/site-packages/silkaj/blockchain_tools.py", line 51, in get_head                                                                           
    return await client(blockchain.current)                                                                                                                                         
  File "/usr/lib/python3.9/site-packages/duniterpy/api/bma/blockchain.py", line 270, in current                                                                                     
    return await client.get(MODULE + "/current", schema=BLOCK_SCHEMA)                                                                                                               
  File "/usr/lib/python3.9/site-packages/duniterpy/api/client.py", line 362, in get                                                                                                 
    response = await client.requests_get(url_path, **params)                                                                                                                        
  File "/usr/lib/python3.9/site-packages/duniterpy/api/client.py", line 238, in requests_get                                                                                        
    response = await self.connection_handler.session.get(                                                                                                                           
  File "/usr/lib/python3.9/site-packages/aiohttp/client.py", line 619, in _request                                                                                                  
    break                                                                                                                                                                           
  File "/usr/lib/python3.9/site-packages/aiohttp/helpers.py", line 656, in __exit__                                                                                                 
    raise asyncio.TimeoutError from None                                                                                                                                            
asyncio.exceptions.TimeoutError                                                                                                                                                     
ERROR:asyncio:Unclosed client session                                                                                                                                               
client_session: <aiohttp.client.ClientSession object at 0x7feda4804370>

Ok, ton installation fonctionne. Surement le nœud Ğ1-test officiel donne un timeout.

La commande silkaj -p duniter.moul.re history FueWuNacjH3J2AFsj5gwezgrJMUPeNZUn77YrGK8uepF

donne une fois des Timeout, l’autre fois quand on reteste, marche