osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ImportError: No module named Adafruit_SSD1306 Update


On 05/12/2019 19:30, Rhodri James wrote:
> On 05/12/2019 18:49, RobH wrote:
>> Update:
>> I did python3 Internet.py
>> and now only get this error:
>>
>> pi at raspberrypi:~/Downloads $ python3 Internet.py
>> ?? File "Internet.py", line 24
>> ???? font = ImageFont.truetype( 'Minecraftia.ttf', 35)
>> ???????????????????????????????????????????????????? ^
>> TabError: inconsistent use of tabs and spaces in indentation
>>
>> I cannot see what is wrong, as the text is all lined up with that 
>> above and below:
> 
> The problem will be that you have a mix of tabs and spaces in your 
> indentation.? This causes problems because some people don't think that 
> the One True Tab Width is 8 characters ;-) so to them the indentation 
> looks ragged.? Worse, when they mix tabs and spaces, code that looks to 
> be at the same indentation level to them looks different to the 
> interpreter.? The decision was taken a while ago that Python should put 
> its foot down about this, and demand that we use either all tabs or all 
> spaces for our indentation.? That's what you've fallen foul off; there 
> must be a mix of tabs and spaces in that line!

Or more likely you've used tabs on that line and spaces elsewhere, or 
vice versa.  I should have remember to say that, sorry.

-- 
Rhodri James *-* Kynesim Ltd