Python library issue

Hi everyone,

I’m installing the toolchain on a fresh macOS Catalina system.
The toolchain compiles fine on Master.

But when I’m trying to compile on v1.10 with git checkout v1.10 followed by make px4_fmu-v5 I get the following error
Failed to import yaml.
You may need to install it with 'sudo pip install pyyaml'

The packages yaml is already installed in /usr/local/lib/python3.8/site-packages
I tried to install it many times.

I also tried to install the packages inside pipenv, but the error message remains.

Any advice?
Is there an easy workaround?

Thanks,

Romain

Do you have python2.X in your path? Check the PATH variable in your environment.

Hi fulano,

Yes by typing type -a python2 I get python2 is /usr/bin/python2,
I tried removing /usr/bin from PATH, but then the make command is not recognized.
From what I know PATH is used by several applications so I don’t want to alter it.
Any suggestions?

You can try modifying the PYTHONPATH env variable to hold the path for python 3.x only; for example: export PYTHONPATH=/usr/local/lib/python3.8/site-packages or /usr/local/lib/python3/site-packages. Other possibilities are: /usr/lib/python3.8/site-packages, or similar names using dist-packages instead of site-packages (if you have those). You may combine all of them in PYTHONPATH using colons ( : ), like this: export PYTHONPATH=option0:option1:option2:etc.

Thank you for this reply, I actually returned my Mac as I was not able to work with it.

I hope this answer will help others.