Trying to get a Rpi4 to work with a grovePi kit with no success, have been lurking in the forum and testing different proposed solutions but I’m still stuck at an error when I try running:
ux-aarch64.egg/cffi/setuptools_ext.py", line 109, in _add_c_module
File "/tmp/easy_install-i4zgAG/smbus-cffi-0.5.1/.eggs/cffi-1.16.0-py2.7-linux-aarch64.egg/cffi/_shimmed_dist_utils.py", line 16
raise Exception("This CFFI feature requires setuptools on Python >= 3.12. The setuptools module is missing or non-functional.") from ex
^
SyntaxError: invalid syntax
The error suggests setuptools is not installed but when checking it shows that it is properly installed for both python2 and python3:
At the present time there are pretty specific requirements for the particular OS to use and if you aren’t using it, you are pretty much hozed as @noobsonfire8 found out:
. . . as well as @cyclicalobsessive’s many useful posts on the subject for help getting it to work.
Note that the only operating system that currently works with the Grove-Pi is this Raspbian image, after you “curl” the appropriate Grove-Pi libraries into it.
after installing that image I pretty much just sudo update, use raspi-config to enable I2C and try to run the curl install which led me to the error in the original post.
Thanks for the reply again, here are the results for the commands provided:
python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import grovepi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'grovepi'
>>>
curl -kL dexterindustries.com/update_sensors | bash
...
File "/tmp/easy_install-zkKbxN/smbus-cffi-0.5.1/.eggs/cffi-1.16.0-py2.7-linux-armv7l.egg/cffi/_shimmed_dist_utils.py", line 16
raise Exception("This CFFI feature requires setuptools on Python >= 3.12. The setuptools module is missing or non-functional.") from ex
^
SyntaxError: invalid syntax
...
Installed /usr/local/lib/python3.7/dist-packages/Line_Follower-1.0.0-py3.7.egg
Processing dependencies for Line-Follower==1.0.0
Searching for python-periphery==2.4.1
Best match: python-periphery 2.4.1
Processing python_periphery-2.4.1-py3.7.egg
python-periphery 2.4.1 is already the active version in easy-install.pth
Using /usr/local/lib/python3.7/dist-packages/python_periphery-2.4.1-py3.7.egg
Finished processing dependencies for Line-Follower==1.0.0
Configuring the red line follower in DI_Sensors installation
Done configuring the red line follower in DI_Sensors installation
pi@grovetest:~ $ $ sudo git clone https://github.com/DexterInd/RFR_Tools.git /home/pi/Dexter/lib/Dexter/RFR_Tools
-bash: $: command not found
pi@grovetest:~ $ $ sudo apt-get install libffi-dev
-bash: $: command not found
pi@grovetest:~ $ $ cd /home/pi/Dexter/lib/Dexter//RFR_Tools/miscellaneous/
-bash: $: command not found
pi@grovetest:~ $ $ sudo python3 setup.py install
-bash: $: command not found
pi@grovetest:~ $ sudo git clone https://github.com/DexterInd/RFR_Tools.git /home/pi/Dexter/lib/Dexter/RFR_Tools
fatal: destination path '/home/pi/Dexter/lib/Dexter/RFR_Tools' already exists and is not an empty directory.
pi@grovetest:~ $ sudo apt-get install libffi-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libffi-dev is already the newest version (3.2.1-9).
0 upgraded, 0 newly installed, 0 to remove and 331 not upgraded.
pi@grovetest:~ $ cd /home/pi/Dexter/lib/Dexter//RFR_Tools/miscellaneous/
pi@grovetest:~/Dexter/lib/Dexter/RFR_Tools/miscellaneous $ sudo python3 setup.py install
running install
running bdist_egg
running egg_info
writing Dexter_AutoDetection_and_I2C_Mutex.egg-info/PKG-INFO
writing dependency_links to Dexter_AutoDetection_and_I2C_Mutex.egg-info/dependency_links.txt
writing requirements to Dexter_AutoDetection_and_I2C_Mutex.egg-info/requires.txt
writing top-level names to Dexter_AutoDetection_and_I2C_Mutex.egg-info/top_level.txt
reading manifest file 'Dexter_AutoDetection_and_I2C_Mutex.egg-info/SOURCES.txt'
writing manifest file 'Dexter_AutoDetection_and_I2C_Mutex.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
creating build/lib
copying auto_detect_robot.py -> build/lib
copying auto_detect_rpi.py -> build/lib
copying I2C_mutex.py -> build/lib
copying di_i2c.py -> build/lib
copying di_mutex.py -> build/lib
creating build/bdist.linux-armv7l/egg
copying build/lib/auto_detect_robot.py -> build/bdist.linux-armv7l/egg
copying build/lib/di_i2c.py -> build/bdist.linux-armv7l/egg
copying build/lib/di_mutex.py -> build/bdist.linux-armv7l/egg
copying build/lib/I2C_mutex.py -> build/bdist.linux-armv7l/egg
copying build/lib/auto_detect_rpi.py -> build/bdist.linux-armv7l/egg
byte-compiling build/bdist.linux-armv7l/egg/auto_detect_robot.py to auto_detect_robot.cpython-37.pyc
byte-compiling build/bdist.linux-armv7l/egg/di_i2c.py to di_i2c.cpython-37.pyc
byte-compiling build/bdist.linux-armv7l/egg/di_mutex.py to di_mutex.cpython-37.pyc
byte-compiling build/bdist.linux-armv7l/egg/I2C_mutex.py to I2C_mutex.cpython-37.pyc
byte-compiling build/bdist.linux-armv7l/egg/auto_detect_rpi.py to auto_detect_rpi.cpython-37.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying Dexter_AutoDetection_and_I2C_Mutex.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Dexter_AutoDetection_and_I2C_Mutex.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Dexter_AutoDetection_and_I2C_Mutex.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Dexter_AutoDetection_and_I2C_Mutex.egg-info/requires.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Dexter_AutoDetection_and_I2C_Mutex.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/Dexter_AutoDetection_and_I2C_Mutex-1.3.2-py3.7.egg' and adding 'build/bdist.linux-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing Dexter_AutoDetection_and_I2C_Mutex-1.3.2-py3.7.egg
Copying Dexter_AutoDetection_and_I2C_Mutex-1.3.2-py3.7.egg to /usr/local/lib/python3.7/dist-packages
Adding Dexter-AutoDetection-and-I2C-Mutex 1.3.2 to easy-install.pth file
Installed /usr/local/lib/python3.7/dist-packages/Dexter_AutoDetection_and_I2C_Mutex-1.3.2-py3.7.egg
Processing dependencies for Dexter-AutoDetection-and-I2C-Mutex==1.3.2
Searching for wiringpi
Reading https://pypi.org/simple/wiringpi/
Downloading https://files.pythonhosted.org/packages/ac/6d/29381c226c296df5896c1e6855acbd59d40fa8b7ee6e82b289cb9dd940ef/wiringpi-2.60.1-cp37-cp37m-linux_armv7l.whl#sha256=7a54e5a879b828eb113228b835a5dbf13695aae06c206ec11940641346fabc24
Best match: wiringpi 2.60.1
Processing wiringpi-2.60.1-cp37-cp37m-linux_armv7l.whl
Installing wiringpi-2.60.1-cp37-cp37m-linux_armv7l.whl to /usr/local/lib/python3.7/dist-packages
Adding wiringpi 2.60.1 to easy-install.pth file
Installed /usr/local/lib/python3.7/dist-packages/wiringpi-2.60.1-py3.7-linux-armv7l.egg
Searching for smbus-cffi
Reading https://pypi.org/simple/smbus-cffi/
Downloading https://files.pythonhosted.org/packages/29/3d/a50bd997979c7554c9c571753d34e976eb88ebf41d3a66accb2468bd3c69/smbus-cffi-0.5.1.tar.gz#sha256=fb4195aaabfc01586863f60d3190b5cb1bf8f12622fd597e23e48768dad6bde8
Best match: smbus-cffi 0.5.1
Processing smbus-cffi-0.5.1.tar.gz
Writing /tmp/easy_install-nhq2e7yy/smbus-cffi-0.5.1/setup.cfg
Running smbus-cffi-0.5.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-nhq2e7yy/smbus-cffi-0.5.1/egg-dist-tmp-utb1okhg
Installed /tmp/easy_install-nhq2e7yy/smbus-cffi-0.5.1/.eggs/cffi-1.16.0-py3.7-linux-armv7l.egg
Searching for pycparser
Reading https://pypi.org/simple/pycparser/
Downloading https://files.pythonhosted.org/packages/62/d5/5f610ebe421e85889f2e55e33b7f9a6795bd982198517d912eb1c76e1a53/pycparser-2.21-py2.py3-none-any.whl#sha256=8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9
Best match: pycparser 2.21
Processing pycparser-2.21-py2.py3-none-any.whl
Installing pycparser-2.21-py2.py3-none-any.whl to /tmp/easy_install-nhq2e7yy/smbus-cffi-0.5.1/.eggs
Installed /tmp/easy_install-nhq2e7yy/smbus-cffi-0.5.1/.eggs/pycparser-2.21-py3.7.egg
creating /usr/local/lib/python3.7/dist-packages/smbus_cffi-0.5.1-py3.7-linux-armv7l.egg
Extracting smbus_cffi-0.5.1-py3.7-linux-armv7l.egg to /usr/local/lib/python3.7/dist-packages
Adding smbus-cffi 0.5.1 to easy-install.pth file
Installed /usr/local/lib/python3.7/dist-packages/smbus_cffi-0.5.1-py3.7-linux-armv7l.egg
Searching for cffi>=1.1.0
Reading https://pypi.org/simple/cffi/
Downloading https://files.pythonhosted.org/packages/68/ce/95b0bae7968c65473e1298efb042e10cafc7bafc14d9e4f154008241c91d/cffi-1.16.0.tar.gz#sha256=bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0
Best match: cffi 1.16.0
Processing cffi-1.16.0.tar.gz
Writing /tmp/easy_install-zl793jyl/cffi-1.16.0/setup.cfg
Running cffi-1.16.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-zl793jyl/cffi-1.16.0/egg-dist-tmp-bwxq02_7
creating /usr/local/lib/python3.7/dist-packages/cffi-1.16.0-py3.7-linux-armv7l.egg
Extracting cffi-1.16.0-py3.7-linux-armv7l.egg to /usr/local/lib/python3.7/dist-packages
Adding cffi 1.16.0 to easy-install.pth file
Installed /usr/local/lib/python3.7/dist-packages/cffi-1.16.0-py3.7-linux-armv7l.egg
Searching for pycparser
Reading https://pypi.org/simple/pycparser/
Downloading https://files.pythonhosted.org/packages/62/d5/5f610ebe421e85889f2e55e33b7f9a6795bd982198517d912eb1c76e1a53/pycparser-2.21-py2.py3-none-any.whl#sha256=8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9
Best match: pycparser 2.21
Processing pycparser-2.21-py2.py3-none-any.whl
Installing pycparser-2.21-py2.py3-none-any.whl to /usr/local/lib/python3.7/dist-packages
Adding pycparser 2.21 to easy-install.pth file
Installed /usr/local/lib/python3.7/dist-packages/pycparser-2.21-py3.7.egg
Searching for python-periphery==2.4.1
Best match: python-periphery 2.4.1
Processing python_periphery-2.4.1-py3.7.egg
python-periphery 2.4.1 is already the active version in easy-install.pth
Using /usr/local/lib/python3.7/dist-packages/python_periphery-2.4.1-py3.7.egg
Searching for pyserial==3.4
Best match: pyserial 3.4
Adding pyserial 3.4 to easy-install.pth file
Using /usr/lib/python3/dist-packages
Finished processing dependencies for Dexter-AutoDetection-and-I2C-Mutex==1.3.2
trying importing grovepi again with no succes:
python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import grovepi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'grovepi'
>>>
I have found a manual installation solution for python3 working with version 10 (Buster) and also for version 11 (the legacy version) but not yet for version 12. Installation is via this script :
The problem is that the original GPG drivers and utilities were written around the time of Moses when there were wooden ships and iron men - and Python 2.n was the happening thing.
Nowadays, Python 2.n is a fossilized relic of its former self, and even things like Python3.7 are considered Ancient History.TM
Unfortunately, refactoring all the associated code to run on Python 3.n, especially the wacked-out versions they have now that stamp their feet and INSIST on Docker containers, is a non-trivial effort by orders of magnitude.
@cyclicalobsessive is working on adapting the GoPiGo libraries for the Pi-5, and porting the Python code was SO GNARLY, that he actually dropped back into the base-level C++ code because it was easier!!
IMHO, any time someone deliberately chooses to program in C++ because Python is more difficult - well you really need to adjust your thinking about the Python code.