Toolchain Install: No module named 'em'

Hi - Iā€™m trying to set up the toolchain on a new (M3) MacBook running Sonoma.

Iā€™ve followed the Mac instructions and run into this error when trying to compile:

On typing: make px4_sitl gazebo-classic

I get:
Failed to import em: No module named ā€˜emā€™

You may need to install it using:
pip3 install --user empy

I try and install empy and get ā€˜Requirement already satisfiedā€™. Have tried PIP uninstall and reinstall: same issue. Have also tried some of the solutions for similar issues in the forum - but sudo solution doesnā€™t work for me.

Can anyone help?

John

Maybe a version greater than a particular version is required.

Thanks Abhishek - which tool are you suggesting to upgrade?

Itā€™s a new Mac so everything is a clean install and should be relatively current.

Iā€™m using:

  • pip3 21.2.4
  • Python 3.9.6

Lastest version of the MacOs documentation

check empy version
is it 3.3.4

Thanks Abhishek - appreciate your help. empy version is 4.2 - not sure if I need to downgrade?

Am new to PX4 development - wondered if the compiler error ā€˜Failed to import em: No module named ā€˜emā€™ā€™ error message was some sort of path issue somewhere?

Px4 requires the version i mentioned.
use : pip install empy==3.3.4
Note : dont use sudoā€¦

To know if this is a path error maybe
Try manual importing em in python shell.

You can find required versions in requirements.txt

Thanks Abhishek - I see empy must be equal to that version - not sure how it went wrong as I followed the MacOs instructions.

Iā€™ll have a play to downgrade that component and see if it works.

Really appreciate the help

John.

Am now on empy 3.3.4 however still getting an ā€˜Failed to import em: No module named ā€˜emā€™ error :frowning:

Will research manual importing in python shell - little new to this coming from an IOS dev background.

Further investigation - looks like the standard install has left me with 2 version of Python - v3.9.6 and v3.12

Am trying to use venv to manage access to right packages - not go there yet.

I canā€™t see the right version of python in the requirement.txt file - any recommendation before I try to uninstall one?

1 Like

i am using Python 3.10.12 and it works fine.

Thanks Abhishek - I think the main setup and therefore the default instructions end up with 2 versions of python installed 3.9 and 3.12.

I cleared my .venv and set it up from scratch with a single python version (3.12) - seemed to clear the import not found error - which is a step forward.

Still not building cleanly but Iā€™ll investigate that separately.

Really appreciate your help