Okay, ich programmiere einen Roboter mit pi2go.py importiert in mein Programm. Ich betreibe Linux debian auf Raspberry Pi (Linux raspberrypi 4.1.19-v7 +). Pi2go importiert pca9685.py, das smbus importiert. Zuallererst war der smbus nicht auf meinem System installiert, also habe ich ein smbus-cffi-Paket für python. Ok, jetzt kopierte ich das smbus Verzeichnis in das selbe Verzeichnis wie meine Dateien sind, danach habe ich es installiert Python sagte, dass ich versuche, ein relatives Paket zu bekommen, so dass ich mich nicht genau an den Fehler erinnere, aber irgendwas daran Art und Weise, Ok, ich von SMBus auf die Import-Anweisung hinzugefügt, die SMBus importiert:ImportError: Kein Modul namens _smbus_cffi
Hier ist die pca9685.py: (I verändert nur die Import-Anweisung So ist dies nur ein Teil davon):
#!/usr/bin/python
#
# PCA9685 Library
# Purely used for Pi2Go, so not as flexible as other libraries
#
# Created by Gareth Davies, Feb 2016
# Copyright 4tronix
#
# This code is in the public domain and may be freely copied and used
# No warranty is provided or implied
#
#======================================================================
from smbus import smbus, time
bus = smbus.SMBus(1)
PCA = 0x40 # Fixed I2C Address of PC9685
SERVOS = 6+48
RED = 14
GREEN = 10
and program continues...
Dann versuche ich, mein Programm erneut auszuführen, und es gibt einen Fehler, der besagt:
Dies ist alles, was in meinem Ordner:
__about__.py lightTest.py pca9685.pyc smbus switchTest.py
beebot1.py linetest.py pi2go.py smbuscffi testLEDs.py
beebot.py lineTest.py pi2go.pyc smbus-cffi util.py
__init__.py liteTest.py servod smbus.py
IRTest.py motorTest.py servoTest.py smbus.pyc
LEDTest.py pca9685.py sgh_PCF8591P.py sonarTest.py
Also, die Frage ist, Ich bin ich dies völlig falsch zu machen oder wo bekomme ich das Modul __smbus_cffi? Ich habe überall nach diesem __smbus_cffi Modul