Hi,
I used to upgrade the Trezor T firmware using trezorctl library from the comnand line. I did not upgrade long time ago and I wanted to update first the packages before do the upgrade. So, first I update the libraries following this doc
After, I wanted to check if all the process was successful but for my surprise, I got that error
Traceback (most recent call last):
File "/home/me/.local/bin/trezorctl", line 7, in <module>
from trezorlib.cli.trezorctl import cli
File "/home/me/.local/lib/python3.6/site-packages/trezorlib/cli/__init__.py", line 25, in <module>
from ..client import TrezorClient
File "/home/me/.local/lib/python3.6/site-packages/trezorlib/client.py", line 24, in <module>
from . import exceptions, mapping, messages, models
File "/home/me/.local/lib/python3.6/site-packages/trezorlib/mapping.py", line 100, in <module>
DEFAULT_MAPPING = ProtobufMapping.from_module(messages)
File "/home/me/.local/lib/python3.6/site-packages/trezorlib/mapping.py", line 83, in from_module
for entry in message_types:
TypeError: 'module' object is not iterable
that works like a charm!
Now to understand the process, why do we need to do force-reinstall if we delete the folder, wouldn’t be enough with just a pip3 install trezor
Thanks for your time!
Not every part of trezor installation lives in the folder you manually deleted. I also can’t be sure if pip will be aware that the package is gone by just deleting the directory.
--force-reinstall makes pip ignore the fact that there might still be pieces of the package, and install it anyway.
To be clear, usually you could either (a) only do pip install --force-reinstall, or (b) the standard thing, pip uninstall && pip install.
In this case, it seemed to me that the contents of the directory got mixed up somehow between different installs. So I was not sure if pip just by itself would do everything needed to fix the problem. Hence manually deleting the directory.