Mbed cli on ubuntu always warns about missing python modules

I just updated my Ubuntu system from 18.04 to 20.04. mbed commands now either say:

[mbed] Auto-installing missing Python modules (pyserial, jinja2, cryptography, click)...

(that was from mbed deploy) or (from mbed export -i eclipse_gcc_arm):

[mbed] WARNING: Missing Python modules were not auto-installed.
       The Mbed OS tools in this program require the following Python modules: pyserial, jinja2, cryptography, click
       You can install all missing modules by running "pip install -r requirements.txt" in "/home/ned/myproject/mbed-os"
       On Posix systems (Linux, etc) you might have to switch to superuser account or use "sudo"

However, I’ve done both sudo pip3 install -r requirements.txt and manually installed the four listed modules (pyserial, jinja2, cryptography, click).

I’ve checked this by running pip3 list, as well as re-trying the pip3 install -r requirements.txt (with and without sudo).

The mbed commands seem to work, so maybe this is OK, but I’m worried that something is going to go wrong. Plus the warnings are annoying.

I have updated my Python 3 installation to 3.8.2, and I don’t have PYTHONPATH set.

I have tried making my user site-packages directory un-readable to verify that Python is looking in the system site-packages directory; this made no difference to the messages.

What can I do to fix this?

Maybe one python module from the requirements is missing and cannot be installed, I had this problem also recently.
To fix it, you need to know which module causes the problem. Run pip3 install -r requirements.txt in the mbed-os dir, then you should see the module where it hangs. It may happen that a requested version is no longer available, then you can edit the requirements.txt and use higher version for that module. Run the pip install again to check if it is ok and undo the changes to make the mbed-os equal with the git branch.

1 Like

I noticed this sometime ago but it never came to the top of my list of things to investigate.

I believe it applies if using Python 2 (although perhaps no one should be using Python 2 any more). And on Windows.

Might be nice if the tool team could just sort it out! :slight_smile:

I also see warnings in the compile, which I think is more important. I would try and fix them but, again, I just never manage to get it to the top of the list of things to do! :frowning: