Errors while installing GrovePi on latest Raspian OS

Hi,

I tried to install GrovePi on a fresh OS on a RasPi Model B with this command:

sudo curl -kL dexterindustries.com/update_grovepi | bash

At first it ran smoothly, but at the end, it threw errors like so:

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/setuptools/sandbox.py”, line 156, in save_modules
yield saved
File “/usr/lib/python3/dist-packages/setuptools/sandbox.py”, line 198, in setup_context
yield
File “/usr/lib/python3/dist-packages/setuptools/sandbox.py”, line 259, in run_setup
_execfile(setup_script, ns)
File “/usr/lib/python3/dist-packages/setuptools/sandbox.py”, line 46, in _execfile
exec(code, globals, locals)
File “/tmp/easy_install-26w92ks4/smbus-cffi-0.5.1/setup.py”, line 17, in
Permission is hereby granted, free of charge, to any person obtaining a copy
File “/usr/lib/python3/dist-packages/setuptools/init.py”, line 108, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/_distutils/core.py”, line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/_distutils/core.py”, line 201, in run_commands
dist.run_commands()
File “/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py”, line 969, in run_commands
self.run_command(cmd)
File “/usr/lib/python3/dist-packages/setuptools/dist.py”, line 1213, in run_command
super().run_command(command)
File “/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py”, line 988, in run_command
cmd_obj.run()
File “/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py”, line 165, in run
cmd = self.call_command(‘install_lib’, warn_dir=0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py”, line 151, in call_command
self.run_command(cmdname)
File “/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py”, line 318, in run_command
self.distribution.run_command(command)
File “/usr/lib/python3/dist-packages/setuptools/dist.py”, line 1213, in run_command
super().run_command(command)
File “/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py”, line 987, in run_command
cmd_obj.ensure_finalized()
File “/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py”, line 111, in ensure_finalized
self.finalize_options()
File “/usr/lib/python3/dist-packages/setuptools/command/install_lib.py”, line 17, in finalize_options
self.set_undefined_options(‘install’,(‘install_layout’,‘install_layout’))
File “/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py”, line 296, in set_undefined_options
setattr(self, dst_option, getattr(src_cmd_obj, src_option))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py”, line 107, in getattr
raise AttributeError(attr)
AttributeError: install_layout. Did you mean: ‘install_platlib’?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/pi/Dexter/GrovePi/Software/Python/setup.py”, line 88, in
setuptools.setup(
File “/usr/lib/python3/dist-packages/setuptools/init.py”, line 108, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/_distutils/core.py”, line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/_distutils/core.py”, line 201, in run_commands
dist.run_commands()
File “/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py”, line 969, in run_commands
self.run_command(cmd)
File “/usr/lib/python3/dist-packages/setuptools/dist.py”, line 1213, in run_command
super().run_command(command)
File “/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py”, line 988, in run_command
cmd_obj.run()
File “/usr/lib/python3/dist-packages/setuptools/command/install.py”, line 74, in run
self.do_egg_install()
File “/usr/lib/python3/dist-packages/setuptools/command/install.py”, line 131, in do_egg_install
cmd.run(show_deprecation=False)
File “/usr/lib/python3/dist-packages/setuptools/command/easy_install.py”, line 444, in run
self.easy_install(spec, not self.no_deps)
File “/usr/lib/python3/dist-packages/setuptools/command/easy_install.py”, line 686, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/command/easy_install.py”, line 733, in install_item
self.process_distribution(spec, dist, deps)
File “/usr/lib/python3/dist-packages/setuptools/command/easy_install.py”, line 778, in process_distribution
distros = WorkingSet([]).resolve(
^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 815, in resolve
dist = self._resolve_dist(
^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 851, in _resolve_dist
dist = best[req.key] = env.best_match(
^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 1123, in best_match
return self.obtain(req, installer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 1135, in obtain
return installer(requirement)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/command/easy_install.py”, line 705, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/command/easy_install.py”, line 731, in install_item
dists = self.install_eggs(spec, download, tmpdir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/command/easy_install.py”, line 924, in install_eggs
return self.build_and_install(setup_script, setup_base)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/command/easy_install.py”, line 1198, in build_and_install
self.run_setup(setup_script, setup_base, args)
File “/usr/lib/python3/dist-packages/setuptools/command/easy_install.py”, line 1182, in run_setup
run_setup(setup_script, args)
File “/usr/lib/python3/dist-packages/setuptools/sandbox.py”, line 249, in run_setup
with setup_context(setup_dir):
File “/usr/lib/python3.11/contextlib.py”, line 155, in exit
self.gen.throw(typ, value, traceback)
File “/usr/lib/python3/dist-packages/setuptools/sandbox.py”, line 190, in setup_context
with save_modules():
File “/usr/lib/python3.11/contextlib.py”, line 155, in exit
self.gen.throw(typ, value, traceback)
File “/usr/lib/python3/dist-packages/setuptools/sandbox.py”, line 169, in save_modules
saved_exc.resume()
File “/usr/lib/python3/dist-packages/setuptools/sandbox.py”, line 143, in resume
raise exc.with_traceback(self._tb)
File “/usr/lib/python3/dist-packages/setuptools/sandbox.py”, line 156, in save_modules
yield saved
File “/usr/lib/python3/dist-packages/setuptools/sandbox.py”, line 198, in setup_context
yield
File “/usr/lib/python3/dist-packages/setuptools/sandbox.py”, line 259, in run_setup
_execfile(setup_script, ns)
File “/usr/lib/python3/dist-packages/setuptools/sandbox.py”, line 46, in _execfile
exec(code, globals, locals)
File “/tmp/easy_install-26w92ks4/smbus-cffi-0.5.1/setup.py”, line 17, in
Permission is hereby granted, free of charge, to any person obtaining a copy
File “/usr/lib/python3/dist-packages/setuptools/init.py”, line 108, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/_distutils/core.py”, line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/_distutils/core.py”, line 201, in run_commands
dist.run_commands()
File “/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py”, line 969, in run_commands
self.run_command(cmd)
File “/usr/lib/python3/dist-packages/setuptools/dist.py”, line 1213, in run_command
super().run_command(command)
File “/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py”, line 988, in run_command
cmd_obj.run()
File “/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py”, line 165, in run
cmd = self.call_command(‘install_lib’, warn_dir=0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py”, line 151, in call_command
self.run_command(cmdname)
File “/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py”, line 318, in run_command
self.distribution.run_command(command)
File “/usr/lib/python3/dist-packages/setuptools/dist.py”, line 1213, in run_command
super().run_command(command)
File “/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py”, line 987, in run_command
cmd_obj.ensure_finalized()
File “/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py”, line 111, in ensure_finalized
self.finalize_options()
File “/usr/lib/python3/dist-packages/setuptools/command/install_lib.py”, line 17, in finalize_options
self.set_undefined_options(‘install’,(‘install_layout’,‘install_layout’))
File “/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py”, line 296, in set_undefined_options
setattr(self, dst_option, getattr(src_cmd_obj, src_option))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py”, line 107, in getattr
raise AttributeError(attr)
AttributeError: install_layout

Running the blink example also threw errors:

pi@grove-pi:~/Dexter/GrovePi/Software/Python $ sudo python grove_led_blink.py
Traceback (most recent call last):
File “/home/pi/Dexter/GrovePi/Software/Python/grove_led_blink.py”, line 37, in
from grovepi import *
File “/home/pi/Dexter/GrovePi/Software/Python/grovepi.py”, line 54, in
import di_i2c
ModuleNotFoundError: No module named ‘di_i2c’

Does anyone know where the problem might be?

1 Like

First) Which OS you are attempting to install over? All bets are off if not
https://downloads.raspberrypi.com/raspios_oldstable_armhf/images/raspios_oldstable_armhf-2023-05-03/

Second) Yes, this sounds like the same issue with installing GoPiGo3 software over 32-bit Buster, for which the work around is:

  1. Update the OS:
sudo apt update
sudo apt -y upgrade
sudo reboot
  1. Install DI_Sensors (fails but does most of the install correct):
curl -kL dexterindustries.com/update_sensors | bash
  1. FIX Broken Python3 Installation of I2C_mutex (Dexter-AutoDetection-and-I2C-mutex egg)
cd ~/Dexter/lib/Dexter/RFR_Tools/miscellaneous/
sudo python3 setup.py install
  1. Test your installation:
python3
>>> import I2C_mutex
>>> import di_sensors
>>> (ctrl-d)
1 Like

Quite frankly, I’m not sure where you got this from. . . .

The latest “full” version of Buster 32 bit was released on 05/07/2021 and is the one I downloaded and used. (8.01 gigs image size)

Yours is much smaller, (3.68 gigs image size) and is dated 05/03/2023.  I’m wondering if it even has a desktop - or is it the “headless” (command-line) version?

Where in God’s Holy Name did a BUSTER image come from in 2023? The ones that I was able to link to from the Raspberry Pi home page were the 2021 (full) versions.  By 2023, I figured (with respect to the Raspberry Pi people), that Buster was Dead and Buried, the wake had been done, and it was all tidied up and ready.  Now one shows up from 2023 ?!!

I will go ask. . . .

Update:

I did.

https://forums.raspberrypi.com/viewtopic.php?t=377386

We will see what happens.

Update:

This appears to be the “lite”, (no desktop), version which was kept updated beyond the “full” edition that I have.

I am going to assume that they feed from the same (source) tree and my updates and their updates eventually leave us in the same place. . . .

And no.  I have absolutely no desire to load that up, and then build it out to the full edition - or at least with a desktop - I have enough on my plate as it is.

1 Like

It is the last Buster with desktop (w/o recommended fluff)

Go To https://raspberrypi.org/software

Scroll down:

I booted it up to check - set boot to desktop with login, enabled VNC, set resolution to 1920, in raspi-config and used TIgerVNC to it:

p.s. I have never in 10 years of playing with the Raspberry Pi needed something from the “Recommended Software” so the fact that a “Buster with desktop and recommended software” is no longer listed in the legacy archive list, it did not cross my mind to go looking for it.

I listed the “What’s the difference?” between the Desktop with Recommended Software vs just Desktop versions there.

1 Like

I am using Rapsberry Pi OS (32-bit) Bookworm, published 2024-07-04, downloaded with Raspberry Pi Imager v1.8.5

2 Likes

Thanks for the adivce. Tried it, but the Python setup also ran into errors.

Nonetheless “import I2C_mutex” worked after that, but “import di_sensors” still throws error (ModuleNotFoundError)

2 Likes

I cannot help you with installing on Bookworm.

1 Like

After doing some research on the forum i’m trying buster now

2 Likes

Perhaps this post will help:

1 Like

Yeah. That’s the image i am using now. The 2 import statements are now working, but when trying to start the example project GrovePi/Software/Python/grove_rgb_lcd/example.py it responds with

Traceback (most recent call last):
File “/usr/local/lib/python3.7/dist-packages/smbus_cffi-0.5.1-py3.7-linux-armv6l.egg/smbus/smbus.py”, line 81, in open
self._fd = os.open(path, os.O_RDWR, 0)
FileNotFoundError: [Errno 2] No such file or directory: ‘/dev/i2c-1’

:frowning:

2 Likes

did you do the sudo raspi-config step to enable i2c? it appears not.

1 Like

I followed your instructions in this post: GrovePi Installation- Mandatory Reading - #2 by cyclicalobsessive with a fresh installation of the buster image (2023-05-03-raspios-buster-armhf.img.xz).

sudo curl -kL dexterindustries.com/update_grovepi | bash

threw some errors other than the “raise Exception” you mentioned. All other steps ran without errors. version check responded with

pi@grove-pi:~/Dexter/GrovePi/Software/Python $ python grove_firmware_version_check.py
GrovePi has firmware version: 1.4.0

but running the rgb lcd example didn’t work.

pi@grove-pi:~/Dexter/GrovePi/Software/Python/grove_rgb_lcd $ python grove_rgb_lcd.py
Traceback (most recent call last):
  File "grove_rgb_lcd.py", line 115, in <module>
    setRGB(0,128,64)
  File "grove_rgb_lcd.py", line 43, in setRGB
    bus.write_byte_data(DISPLAY_RGB_ADDR,0,0)
IOError: [Errno 121] Remote I/O error

And yes, I did the activation step of the I2C bus.

2 Likes

Remind me:

Which version of the pi and which version of the grove board, (Original Grove? Grove+?), are you using?

Did you enable SPI?

Is there anything else connected to the GPIO pins?

1 Like

It’s a model B (this one: https://botland.de/img/art/inne/00972_2.jpg). The grove board is a GrovePi+. No other GPIO pins are used. Just the grove board is installed. I also enabled SPI.

2 Likes

Deleted - moved to dedicated thread - not install related

1 Like