Nieuws:

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: ImportError: cannot import name 'Servokit' from 'adafruit_servokit'  (gelezen 1737 keer)

Raspberry Pi 3 Model B Rev 1.2
OS:  Debian GNU/Linux 11 (bullseye) aarch64
Python 3.9.2
=======================================
Van een file begint de eerste regel met:
from adafruit_servokit import Servokit

Ik kan wel adafruit_servokit importeren:
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import adafruit_servokit
>>>

Maar  niet:  from adafruit_servokit import Servokit
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from adafruit_servokit import Servokit   <--------- ?????
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Servokit' from 'adafruit_servokit' (/home/henkoegema/.local/lib/python3.9/site-packages/adafruit_servokit.py)

pip show adafruit-circuitpython-servokit:
pip show adafruit-circuitpython-servokit
Name: adafruit-circuitpython-servokit
Version: 1.3.13
Summary: CircuitPython helper library for PWM/Servo FeatherWing, Shield, and Pi HAT and Bonnet kits.
Home-page:
Author:
Author-email: Adafruit Industries <circuitpython@adafruit.com>
License: MIT
Location: /home/henkoegema/.local/lib/python3.9/site-packages
Requires: Adafruit-Blinka, adafruit-circuitpython-busdevice, adafruit-circuitpython-motor, adafruit-circuitpython-pca9685, adafruit-circuitpython-register

Heb het ook getest in een virtual environment. (python3.9 -m venv venv --system-site-packages)
Maar met hetzelfde resultaat.

pip list:
Package                          Version
-------------------------------- ---------
Adafruit-Blinka                  8.18.0
adafruit-circuitpython-busdevice 5.2.4
adafruit-circuitpython-motor     3.4.9
adafruit-circuitpython-pca9685   3.4.8
adafruit-circuitpython-register  1.9.15
adafruit-circuitpython-requests  1.13.1
adafruit-circuitpython-servokit  1.3.13
adafruit-circuitpython-typing    1.9.0
Adafruit-PlatformDetect          3.44.0
Adafruit-PureIO                  1.1.10



Het vreemde is dat het wel heeft gewerkt, maar (plotseling ?) niet meer.
Wie heeft raad?  (zonder helemaal opnieuw te beginnen.  :) )


𝕸𝖎𝖘𝖈𝖊𝖗𝖊 𝖚𝖙𝖎𝖑𝖊 𝖉𝖚𝖑𝖈𝖎. (Ter leering ende vermaeck)
𝕹𝖎𝖑 𝖛𝖔𝖑𝖊𝖓𝖙𝖎𝖇𝖚𝖘 𝖆𝖗𝖉𝖚𝖚𝖒. (Niets is moeilijk voor hen die willen)
https://henk.oegema.com  (Op RaspberryPi2)
Registered linux user 520520.  In gebruik: Ubuntu  24.04 Hobby's: Radio Amateur callsign: PA2HO.  Interesses: Raspberry Pi & Arduino & TELLO drone (voor AI)

Re: ImportError: cannot import name 'Servokit' from 'adafruit_servokit'
« Reactie #1 Gepost op: 2023/04/19, 13:37:36 »
Raspberry Pi 3 Model B Rev 1.2
OS:  Debian GNU/Linux 11 (bullseye) aarch64
Python 3.9.2
=======================================
Van een file begint de eerste regel met:
from adafruit_servokit import Servokit

Ik kan wel adafruit_servokit importeren:
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import adafruit_servokit
>>>

Maar  niet:  from adafruit_servokit import Servokit
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from adafruit_servokit import Servokit   <--------- ?????
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Servokit' from 'adafruit_servokit' (/home/henkoegema/.local/lib/python3.9/site-packages/adafruit_servokit.py)

pip show adafruit-circuitpython-servokit:
pip show adafruit-circuitpython-servokit
Name: adafruit-circuitpython-servokit
Version: 1.3.13
Summary: CircuitPython helper library for PWM/Servo FeatherWing, Shield, and Pi HAT and Bonnet kits.
Home-page:
Author:
Author-email: Adafruit Industries <circuitpython@adafruit.com>
License: MIT
Location: /home/henkoegema/.local/lib/python3.9/site-packages
Requires: Adafruit-Blinka, adafruit-circuitpython-busdevice, adafruit-circuitpython-motor, adafruit-circuitpython-pca9685, adafruit-circuitpython-register

Heb het ook getest in een virtual environment. (python3.9 -m venv venv --system-site-packages)
Maar met hetzelfde resultaat.

pip list:
Package                          Version
-------------------------------- ---------
Adafruit-Blinka                  8.18.0
adafruit-circuitpython-busdevice 5.2.4
adafruit-circuitpython-motor     3.4.9
adafruit-circuitpython-pca9685   3.4.8
adafruit-circuitpython-register  1.9.15
adafruit-circuitpython-requests  1.13.1
adafruit-circuitpython-servokit  1.3.13
adafruit-circuitpython-typing    1.9.0
Adafruit-PlatformDetect          3.44.0
Adafruit-PureIO                  1.1.10



Het vreemde is dat het wel heeft gewerkt, maar (plotseling ?) niet meer.
Wie heeft raad?  (zonder helemaal opnieuw te beginnen.  :) )

Na dagen van zoeken eindelijk gevonden.  :-[

"from adafruit_servokit import Servokit"  had moeten zijn "from adafruit_servokit import ServoKit
𝕸𝖎𝖘𝖈𝖊𝖗𝖊 𝖚𝖙𝖎𝖑𝖊 𝖉𝖚𝖑𝖈𝖎. (Ter leering ende vermaeck)
𝕹𝖎𝖑 𝖛𝖔𝖑𝖊𝖓𝖙𝖎𝖇𝖚𝖘 𝖆𝖗𝖉𝖚𝖚𝖒. (Niets is moeilijk voor hen die willen)
https://henk.oegema.com  (Op RaspberryPi2)
Registered linux user 520520.  In gebruik: Ubuntu  24.04 Hobby's: Radio Amateur callsign: PA2HO.  Interesses: Raspberry Pi & Arduino & TELLO drone (voor AI)