Hi. I’m currently trying to install grovepi for a sensor that I need for my Raspberry Pi. But I constantly get a module not found error for cython, even though I know for sure it’s installed.
I’ve already tried to uninstall and install cython multiple times, but with no success. When I type pip list it shows that Cython is within the list, yet I still get the same error when trying to install grovepi.
No matter what I seem to do, it insists that the module cannot be found. My question is, am I doing something wrong, or am I missing something here? Is the problem within the package?
Thank you in advance for any help.
Error:
Processing scipy/signal/_spectral.pyx
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'Cython'
Which version of the Raspberry Pi-4 are you using? 2g? 4g? 8g?
Have you looked at the previous thread on this very same topic?
An old boss of mine once said: “The Devil’s in the details.”
I understand you may not want to create a wall of words, but specific details about the hardware, the software, what Grove-Pi connector you are using, if anything else ever worked, etc. etc. etc. are all essential information.
This is the exact OS: Raspbian GNU/Linux 11 (bullseye)
I’m using the Raspberry Pi 4 model B Rev 1.4, 8gb
I’ve read through the thread and could not find anything specifically related to my issue, although I believe this error is not related to the sensor I’m using, but more in the installing process. To make the script work for the sensor, I need grovepi, which I’m currently experiencing errors with in the installment process. I could be wrong though, and please do correct me if I am.
I’ve tried installing Cython through python3 as well, but the same error persists.
Here is an attached image (screenshot) of the error of Cython I’m receiving (and right before). Not sure if this is useful, but will add it nonetheless.
There are two potential issues I see here right away:
Raspbian (Raspberry Pi O/S) Bullseye.
Raspberry Pi-4 8 Gb
The Bullseye release is too advanced and (as yet) the older Dexter/Modular Robotics software has trouble with it.
The Raspberry Pi-4, 8 Gb version is also very advanced and I do not know what software it does, or does not, work with.
In a thread very similar to yours, another person was able to get his Grove-Pi working on a Pi-4, (4gb?) by downloading a different version of the software.
Viz.:
I am assuming that you are running from an SD card, right?
I do not know if this will work on an 8 gig Pi-4, but try downloading the Buster release mentioned in that posting and try again.
Hi, I’ve managed to install the new software via an SD card.
The good news is that the problems I experienced before, are not present anymore and grovepi seems to be have been installed correctly.
I have the following Python code to run my sensor:
# py.py (desktop directory)
import time
import grovepi
# Connect the Grove PH Sensor to analog port A0
# SIG,NC,VCC,GND
sensor = 0
grovepi.pinMode(sensor,"INPUT")
time.sleep(1)
# Reference voltage of ADC is 5v
adc_ref = 3.3
while True:
print('run')
try:
# Read sensor value
sensor_value = grovepi.analogRead(sensor)
# Calculate PH
ph = 7 - 1000 * (float)(sensor_value) * adc_ref / 59.16 / 1023
print("sensor_value =", sensor_value, " ph =", ph)
except IOError:
print ("Error")
The error I’m experiencing is when I run the script with python3 ph.py, it doesn’t do anything and shows nothing. From what I can tell, it goes to the loop and tries the block of code, but nothing seems to happen when it tries(it shows blank). It seems to only iterate (tries to iterate) 1 time, but not more. When I press CTRL + c it does give me an error in return:
The error I get when running the script, and then pressing CTRL + c after a few minutes