Giter Club home page Giter Club logo

Comments (3)

xAlstrat avatar xAlstrat commented on June 3, 2024 3

I managed to solve it. Just use the normal python installation version, not the python3 version. Debian buster image uses python3 as python, same for pip.

This is my Dockerfile:

FROM arm32v7/python:3.7-slim

ENV PYTHONUNBUFFERED 1

WORKDIR /code/
RUN apt-get update && \
    apt-get install -y tcl tk gcc make curl gnupg git && \
    echo "deb https://seeed-studio.github.io/pi_repo/ stretch main" | tee /etc/apt/sources.list.d/seeed.list && \
    curl https://seeed-studio.github.io/pi_repo/public.key | apt-key add - && \
    apt-get update && apt-get install -y python-rpi.gpio python-mraa python-upm && \
    git clone https://github.com/Seeed-Studio/grove.py && pip install ./grove.py
COPY ./requirements.txt /code/requirements.txt
RUN pip install --upgrade pip && pip install -r /code/requirements.txt
COPY . /code/

CMD python /code/main.py

I had to install git and curl (ignore some libs like tcl and tk, those are specific to my project).

from grove.py.

darthkurak avatar darthkurak commented on June 3, 2024

I tried this also on python:3.5-buster image (3.5.9) but this still occur :(

from grove.py.

mgfink avatar mgfink commented on June 3, 2024

I found this thread as we're also trying to run a script that makes use of grove.py from within a container. However, the above Docker file isn't working and have been trying to hack with different images, python versions, etc. to no avail.

I'm running a Raspberry Pi 4 with Raspbian GNU/Linux 10 (buster). When I run bash on the container in privileged mode and try running the script, I get:

root@0512ceae4514:/code# python script.py
Traceback (most recent call last):
File "script.py", line 5, in
from grove.factory import Factory
File "/usr/local/lib/python3.7/site-packages/grove/factory/init.py", line 2, in
from .factory import *
File "/usr/local/lib/python3.7/site-packages/grove/factory/factory.py", line 38, in
from grove.temperature import *
File "/usr/local/lib/python3.7/site-packages/grove/temperature/init.py", line 2, in
from .mcp9808 import TemperMCP9808
File "/usr/local/lib/python3.7/site-packages/grove/temperature/mcp9808.py", line 38, in
from upm.pyupm_mcp9808 import MCP9808
ModuleNotFoundError: No module named 'upm'

I confirmed the python-upm package is installed and attempted installing python3-upm and got the same error @darthkurak posted:

root@0512ceae4514:/code# apt install python3-upm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
python3-upm : Depends: libpython3.5 (>= 3.5.0~b1) but it is not installable
E: Unable to correct problems, you have held broken packages.

Any suggestions would be greatly appreciated!

Thanks!!

from grove.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.