No module named I2C_mutex

Brand new GoPiGo3, clean new install of Raspbian Stretch, all updated and upgraded. Followed Dexter instructions for software download via curl, looks to be installed correctly: sudo pip freeze | grep gopigo3 returns gopigo == 1.2.0

Tried fix of this problem in previous post, but GoPiGo2 packages were not installed (“cannot unstall…, not installed”)
and installed update_tools per post, rebooted, but still get:

ImportError: No module named I2C_mutex

when attempt to import easygopigo3.

Hi @anitatech,

We are kind of going through a transition period that’s going to be very short where sometimes things (such as this one you mentioned) won’t work. For this issue, please run the following command: it’s going to get the I2C_mutex fixed.

curl -kL dexterindustries.com/update_tools | bash -s -- --install-python-package --use-python3-exe-too

Please keep in mind that this command may no longer be available (or work) in the following weeks - and that’s because we’re undergoing a couple of internal changes.

When everything will be finished, you’ll be able to simply install the GoPiGo3 (or any other robot) just like you did now and it will work.

Thank you!

Hi

I’ve been getting the same error for few days now. The error occurs when software and firmware is updated and i’ve tried it with different operating systems such as Raspbian For Robots and Cinch. I’m using GoPiGo3 and tried it with both python 3 and 2.

The error which occurs:
"Cannot import name ‘Mutex’ "

The command “curl -kL dexterindustries.com/update_tools | bash -s – --install-python-package --use-python3-exe-too” didn’t fix anything for me.

Now when I’m trying to run the command “curl -kL dexterindustries.com/update_tools | bash -s – --install-python-package --use-python3-exe-too” with Raspbian For Robots, it gives a error “error: setup script exited with error: command ‘arm-linux-gnueabihf-gcc’ failed with exit status 1”.

I also followed the instruction provided in this topic with no success:
https://forum.dexterindustries.com/t/solved-importerror-cannot-import-name-mutex/4601

Hi @t6hyja01,

Let’s try it again with the following one:

curl -kL dexterindustries.com/update_tools | bash -s – --install-python-package --use-python3-exe-too --update-aptget --install-deb-deps

Notice that I’ve added 2 extra options.

Edit: I ran the previous command I gave you on a Raspbian For Robots and it worked.

Thank you!

The command executed succesfully but it didn’t fix the error.

This is the whole error:

Traceback (most recent call last):
File “/home/pi/gfda.py”, line 1, in
import easygopigo3 as easy
File “/usr/local/lib/python3.4/dist-packages/gopigo3-1.2.0-py3.4.egg/easygopigo3.py”, line 11, in
from I2C_mutex import Mutex
ImportError: cannot import name ‘Mutex’

Hi @t6hyja01,

My mistake here - looked at the command I gave you and there is a small typo I did. It’s not update_tools, but update_rfrtools. So the idea is that you have to run this:

curl -kL dexterindustries.com/update_rfrtools | bash -s – --install-python-package --use-python3-exe-too --update-aptget --install-deb-deps

Sorry about this - as I have said, we’re undergoing a few internal changes and things can change overnight for the next couple of days (weeks in a worst-case scenario).

And please let us know if this fixes your issue.

Thank you!

Will this work with Stretch + gopigo software as described in my OP?

Hi @anitatech,

On a fresh version of Stretch, it’s enough if you run:

curl -kL dexterindustries.com/update_gopigo3 | sudo bash

This will take care of everything.

Anyway, the command I mentioned in my last reply can be used on Stretch too.

Please let us know if that works for you. Our users’ feedback is quite important to us in this time because as I said, we’re doing a couple of changes and we need to know everything is up and running.

Thank you!

Did not work. Here’s what I did:

  1. Fresh download of latest version of Stretch
    1.5) Fresh batteries
  2. Updated, upgraded
  3. Enabled camera, VNC, I2C
    3.5) Motors unplugged
  4. Ran curl etc per your post
  5. rebooted
  6. gopigo3 == 1.2.0 so installed
  7. Plugged in motors

Results:

  1. Attempt to run easy_DexEyes.py or easy_Distance_Sensor.py (from command line or IDLE): “No module named I2C_mutex”
  2. Runs Motor.py correctly
  3. Attempt to run control_panel_gui_3.py: “No module name I2C_mutex”
  4. Motor encoder programs resulted in L:0 and R:0

What next?

Hi @anitatech,

That doesn’t make any sense - I did the exact same thing and it worked for me. I’m pretty sure there’s a missing link that goes unnoticed.

There’s another thing we can do and that is to clone the repo and then install it manually. Follow these instructions:

  1. Go to /home/pi/Dexter/lib/Dexter, hit sudo rm -rf RFR_Tools directory/repo and then git clone https://github.com/DexterInd/RFR_Tools in that directory. Make sure you’ve got the right permissions.

  2. cd to /home/pi/Dexter/lib/Dexter/RFR_Tools/miscellaneous and then run sudo python setup.py install and sudo python3 setup.py install. This will get the package installed system-wide.

  3. After this, instantiate a shell with Python and try to import I2C_mutex module. If it works, proceed with trying to load easygopigo3 module.

  4. If everything went fine to this point, run your programs then.

Let me know if this time it works for you.

Thank you!

Followed your instructions.

  1. git clone command resulted in “repository not found”. Figured out that it needed to be git clone https://github.com/DexterInd/RFR_Tools

  2. both python installs ended with “Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing ‘libffi.pc’ to the PKG_CONFIG_PATH environment variable” followed by another 4 related errors and finally “c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory”

I’m getting pretty frustrated! All I want is a robotics platform that uses my existing Raspberry Pi 3s (which need to be running Stretch for other classes) to teach Scratch and Python robotics. My $1500 grant application is due in 2 days, but I can’t seem to get this product running and am considering rewriting my proposal to go back to Arduinos. I’m an overworked teacher and don’t really have time to do all of this debugging. Please help!

Hi @anitatech,

Okay, I know what the issue is. Please run an sudo apt-get update and then do the following one:

sudo apt-get install -y build-essential libi2c-dev i2c-tools python-dev python3-dev python-setuptools python3-setuptools python-pip python3-pip libffi-dev

After you do this, please run the installation for the Python package again - the one we discussed in the previous reply. And then please let me know if it worked for you or not. I did try the installation (of R4R_Tools again and even that of the GoPiGo3 and on different versions of Raspbian) and we haven’t had any issues, so at the moment we don’t see the reason why this has failed so bad for you. Hopefully, this is the last thing we need to do.