Trouble installing grovepi, says Cython cannot be found even though it's installed

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'

Installing grovepi through:

curl -kL dexterindustries.com/update_grovepi | bash

I think the install uses python 3 now. Is cython installed for python3?

pip3 list?

2 Likes

Thank you for your reply!

Yes, when I run pip3 list it shows Cython version 0.29.24.

1 Like

Pardon me for butting in. . . .

  • What sensor are you trying to use?
  • What sensor software or whatever are you trying to run?
  • What operating system are you using?
  • What version of the Raspberry Pi are you using?
  • (etc. . .)

Thanks!

1 Like

Thank you for your reply. Here’s the information you requested (let me know if you need to know anything else):

Sensor: pH sensor (E-201C-Blue) with use of ADS1115
Operating system: raspbian os
Raspberry Pi version 4

The software I’m trying to run:

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 = 5

while True:
    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")
1 Like

Which one? There are several.

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.

Thanks!

1 Like

Thanks again for the reply!

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.

I’ve also tried running the following command, but I get a similar error that Python cannot find an installed module.

curl -kL [dexterindustries.com/update_rfrtools](http://dexterindustries.com/update_rfrtools) | bash -s – --install-python-package --use-python3-exe-too --update-aptget --install-deb-deps

This is the error I get there (even though setuptools is installed and shown when I type pip3 list)

Your help is greatly appreciated, thank you.

1 Like

Ahhh!

There are two potential issues I see here right away:

  1. Raspbian (Raspberry Pi O/S) Bullseye.
  2. 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.

2 Likes

Great! I’ll give this a try and see if this solves my issue. I’ll get back to you as soon as I’ve finished.

1 Like

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

To check if my i2c device was connected, I ran the following command:

sudo i2cdetect -y 1

And this is the output (I believe this shows that i2c is working):
unnamed

Thank you again for your time and help!

1 Like