CharLCDPlate Python Software Issue

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
Iceman25
 
Posts: 1
Joined: Sat Nov 30, 2013 11:34 am

CharLCDPlate Python Software Issue

Post by Iceman25 »

Hi,

I'm very new to Python, but familar with C languages and Java. I recently bought the Pi Plate and now got it work with the Tutorial as well.

Because i don't like to always copy the CharLCDPlate.py and the other two Libraries I installed the Adafruit_Libraries via pip.

But when I now try to import the CharLCDPlate.py I get an Error saying:

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/Adafruit/CharLCDPlate/Adafruit_CharLCDPlate.py", line 14, in <module>
    class Adafruit_CharLCDPlate(Adafruit_I2C):
TypeError: Error when calling the metaclass bases
    module.__init__() takes at most 2 arguments (3 given)
And I typed:

Code: Select all

from Adafruit.CharLCDPlate import Adafruit_CharLCDPlate
Whats the Problem?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: CharLCDPlate Python Software Issue

Post by adafruit_support_mike »

Hmm.. I'm gonna have to break out my mask and candles for that one.

Generally speaking, there's a module/class reference conflict somewhere. In more concrete terms, the output you got is one of the vaguest "file not found" errors currently walking the earth. My guess is that it's a conflict between the python library reference rules and the links-in-folders reference system used in the library.

The standard Adafruit-Raspberry-Pi-Python-Code collection contains several pieces that talk to each other. To make that work, we put links to the support code in the same directory as the main script. That lets us call:

Code: Select all

from Adafruit_I2C import Adafruit_I2C
without having to do gymnastics with the file paths (ugly) or include redundant copies of the same code in every context where it's needed (recipe for disaster).

Moving the Adafruit code into Python's official library tree probably changed the way Python thinks about relationships between the module being called and its neighbors. I'll have to do some chicken-waving to find the exact details though.

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”