J’ai fini par réussir à installer avec pip.
Le problème venait d’un mélange entre des commandes avec et sans sudo, comme tu l’as pointé sur le gitlab.
Et il y avait un autre problème parce que pip essayait de se lancer avec python 3.6 qui était mal installé sur la machine.
J’ai donc commencé par réinstaller pip :
$ sudo apt remove python-pip --purge
$ sudo apt remove python3-pip --purge
$ sudo apt autoremove
$ sudo apt install python3-pip
Après j’ai réinstallé silkaj avec pip et j’avais toujours le même problème.
$ pip3 search silkaj
silkaj (0.7.3) - Command line client for Duniter
INSTALLED: 0.7.3 (latest)
$ silkaj
Traceback (most recent call last):
File "/home/simon/.local/bin/silkaj", line 20, in <module>
from silkaj.cli_tools import cli
File "/home/simon/.local/lib/python3.7/site-packages/silkaj/cli_tools.py", line 22, in <module>
from silkaj.tx import send_transaction
File "/home/simon/.local/lib/python3.7/site-packages/silkaj/tx.py", line 24, in <module>
from silkaj.network_tools import ClientInstance, HeadBlock
File "/home/simon/.local/lib/python3.7/site-packages/silkaj/network_tools.py", line 25, in <module>
from duniterpy.api.client import Client
File "/home/simon/.local/lib/python3.7/site-packages/duniterpy/api/client.py", line 9, in <module>
import jsonschema
File "/usr/local/lib/python3.7/dist-packages/jsonschema/__init__.py", line 11, in <module>
from jsonschema.exceptions import (
File "/usr/local/lib/python3.7/dist-packages/jsonschema/exceptions.py", line 152, in <module>
@attr.s(hash=True)
AttributeError: module 'attr' has no attribute 's'
J’ai cherché et je suis tombé sur stackoverflow avec une explication. Il y a un truc qui coince entre les packages « attr » et « attrs » que j’avais installé tous les deux.
$ pip3 list
Package Version
------------------- ---------
(...)
attr 0.3.1
attrs 19.3.0
Désinstallation des deux. attrs avait été installé avec sudo en plus…
$ pip3 uninstall attr
Uninstalling attr-0.3.1:
Would remove:
/home/simon/.local/lib/python3.7/site-packages/attr-0.3.1.dist-info/*
/home/simon/.local/lib/python3.7/site-packages/attr.py
/home/simon/.local/lib/python3.7/site-packages/dry_attr.py
Proceed (y/n)? y
Successfully uninstalled attr-0.3.1
$ pip3 uninstall attrs
Uninstalling attrs-19.3.0:
Would remove:
/usr/local/lib/python3.7/dist-packages/attr/*
/usr/local/lib/python3.7/dist-packages/attrs-19.3.0.dist-info/*
Proceed (y/n)? y
Exception:
Traceback (most recent call last):
File "/usr/lib/python3.7/shutil.py", line 566, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission non accordée: '/usr/local/lib/python3.7/dist-packages/attr/__init__.py' -> '/tmp/pip-uninstall-8zwnp23m/usr/local/lib/python3.7/dist-packages/attr/__init__.py'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/uninstall.py", line 75, in run
auto_confirm=options.yes, verbose=self.verbosity > 0,
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 683, in uninstall
uninstalled_pathset.remove(auto_confirm, verbose)
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_uninstall.py", line 224, in remove
renames(path, new_path)
File "/usr/lib/python3/dist-packages/pip/_internal/utils/misc.py", line 280, in renames
shutil.move(old, new)
File "/usr/lib/python3.7/shutil.py", line 581, in move
os.unlink(src)
PermissionError: [Errno 13] Permission non accordée: '/usr/local/lib/python3.7/dist-packages/attr/__init__.py'
$ sudo pip3 uninstall attrs
Uninstalling attrs-19.3.0:
Would remove:
/usr/local/lib/python3.7/dist-packages/attr/*
/usr/local/lib/python3.7/dist-packages/attrs-19.3.0.dist-info/*
Proceed (y/n)?
Your response ('') was not one of the expected responses: y, n
Proceed (y/n)? y
Successfully uninstalled attrs-19.3.0
Enfin, réinstallation de silkaj :
$ pip3 install silkaj --user
Requirement already satisfied: silkaj in /home/simon/.local/lib/python3.7/site-packages (0.7.3)
Requirement already satisfied: pynacl in /home/simon/.local/lib/python3.7/site-packages (from silkaj) (1.3.0)
Requirement already satisfied: ipaddress in /home/simon/.local/lib/python3.7/site-packages (from silkaj) (1.0.23)
Requirement already satisfied: duniterpy==0.54.3 in /home/simon/.local/lib/python3.7/site-packages (from silkaj) (0.54.3)
Requirement already satisfied: Click in /home/simon/.local/lib/python3.7/site-packages (from silkaj) (7.0)
Requirement already satisfied: texttable in /home/simon/.local/lib/python3.7/site-packages (from silkaj) (1.6.2)
Requirement already satisfied: tabulate in /home/simon/.local/lib/python3.7/site-packages (from silkaj) (0.8.6)
Requirement already satisfied: cffi>=1.4.1 in /home/simon/.local/lib/python3.7/site-packages (from pynacl->silkaj) (1.13.2)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from pynacl->silkaj) (1.13.0)
Requirement already satisfied: attr>=0.3.1 in /usr/local/lib/python3.7/dist-packages (from duniterpy==0.54.3->silkaj) (0.3.1)
Requirement already satisfied: base58>=1.0.0 in /home/simon/.local/lib/python3.7/site-packages (from duniterpy==0.54.3->silkaj) (1.0.3)
Requirement already satisfied: pylibscrypt>=1.7.1 in /home/simon/.local/lib/python3.7/site-packages (from duniterpy==0.54.3->silkaj) (1.8.0)
Requirement already satisfied: pypeg2>=2.15.2 in /home/simon/.local/lib/python3.7/site-packages (from duniterpy==0.54.3->silkaj) (2.15.2)
Requirement already satisfied: pyaes>=1.6.1 in /home/simon/.local/lib/python3.7/site-packages (from duniterpy==0.54.3->silkaj) (1.6.1)
Requirement already satisfied: aiohttp>=3.3.2 in /home/simon/.local/lib/python3.7/site-packages (from duniterpy==0.54.3->silkaj) (3.6.2)
Requirement already satisfied: jsonschema>=2.6.0 in /usr/local/lib/python3.7/dist-packages (from duniterpy==0.54.3->silkaj) (3.2.0)
Requirement already satisfied: libnacl>=1.6.1 in /home/simon/.local/lib/python3.7/site-packages (from duniterpy==0.54.3->silkaj) (1.7)
Requirement already satisfied: pycparser in /home/simon/.local/lib/python3.7/site-packages (from cffi>=1.4.1->pynacl->silkaj) (2.19)
Collecting attrs>=17.3.0 (from aiohttp>=3.3.2->duniterpy==0.54.3->silkaj)
Downloading https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl
Requirement already satisfied: yarl<2.0,>=1.0 in /home/simon/.local/lib/python3.7/site-packages (from aiohttp>=3.3.2->duniterpy==0.54.3->silkaj) (1.4.2)
Requirement already satisfied: chardet<4.0,>=2.0 in /usr/lib/python3/dist-packages (from aiohttp>=3.3.2->duniterpy==0.54.3->silkaj) (3.0.4)
Requirement already satisfied: async-timeout<4.0,>=3.0 in /home/simon/.local/lib/python3.7/site-packages (from aiohttp>=3.3.2->duniterpy==0.54.3->silkaj) (3.0.1)
Requirement already satisfied: multidict<5.0,>=4.5 in /home/simon/.local/lib/python3.7/site-packages (from aiohttp>=3.3.2->duniterpy==0.54.3->silkaj) (4.7.3)
Requirement already satisfied: importlib-metadata; python_version < "3.8" in /usr/local/lib/python3.7/dist-packages (from jsonschema>=2.6.0->duniterpy==0.54.3->silkaj) (1.3.0)
Requirement already satisfied: pyrsistent>=0.14.0 in /home/simon/.local/lib/python3.7/site-packages (from jsonschema>=2.6.0->duniterpy==0.54.3->silkaj) (0.15.6)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from jsonschema>=2.6.0->duniterpy==0.54.3->silkaj) (41.2.0)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3/dist-packages (from yarl<2.0,>=1.0->aiohttp>=3.3.2->duniterpy==0.54.3->silkaj) (2.6)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata; python_version < "3.8"->jsonschema>=2.6.0->duniterpy==0.54.3->silkaj) (0.6.0)
Requirement already satisfied: more-itertools in /usr/local/lib/python3.7/dist-packages (from zipp>=0.5->importlib-metadata; python_version < "3.8"->jsonschema>=2.6.0->duniterpy==0.54.3->silkaj) (8.0.2)
Installing collected packages: attrs
Successfully installed attrs-19.3.0
J’ai rajouté le chemin pour silkaj dans mon ~/.bashrc et j’ai maintenant la bonne version :
$ whereis silkaj
silkaj: /home/simon/.local/bin/silkaj
$ silkaj --version
silkaj, version 0.7.3