No module named micropython

I managed to install the micropython-ssd1327-1.0.0 library,according to this:

formatting link
but after adding: import ssd1327 it returns

File "build/bdist.linux-armv6l/egg/ssd1327.py", line 5, in ImportError: No module named micropython

Have I missed something.

Reply to
RobH
Loading thread data ...

Oops, a bit vague above. I am trying to install the ssd1327 driver for a oled display. Adafruit's library file won't install because

This library is not available on PyPI yet. Install documentation is included as a standard element. Stay tuned for PyPI availability!

So then I found the same driver file for micropython, but I get the above error when I import the said ssd1327 in a python script.

Reply to
RobH

On Wed, 18 Dec 2019 13:54:24 +0000, RobH declaimed the following:

But did you also install /micropython/ itself?

... and if you did, are you invoking it? Micropython is not a module for regular Python, it is a separate limited language interpreter optimized for use on microcontrollers.

A search for "ssd1327 raspberry pi" leads to

formatting link

FYI: from what I can tell, if the Adafruit library

formatting link
can be used, you'll have to install the Adafruit blinka library to provide the CircuitPython interface API.

As for the lack of PyPi availability...

pi@rpi3bplus-1:~$ mkdir scratch pi@rpi3bplus-1:~$ cd scratch pi@rpi3bplus-1:~/scratch$ git init Initialized empty Git repository in /home/pi/scratch/.git/ pi@rpi3bplus-1:~/scratch$ git clone

formatting link
Cloning into 'Adafruit_CircuitPython_SSD1327'... remote: Enumerating objects: 36, done. remote: Counting objects: 100% (36/36), done. remote: Compressing objects: 100% (26/26), done. remote: Total 36 (delta 10), reused 30 (delta 8), pack-reused 0 Unpacking objects: 100% (36/36), done. pi@rpi3bplus-1:~/scratch$ ls Adafruit_CircuitPython_SSD1327 pi@rpi3bplus-1:~/scratch$ cd Adafruit_CircuitPython_SSD1327/ pi@rpi3bplus-1:~/scratch/Adafruit_CircuitPython_SSD1327$ ls adafruit_ssd1327.py docs LICENSE requirements.txt CODE_OF_CONDUCT.md examples README.rst setup.py pi@rpi3bplus-1:~/scratch/Adafruit_CircuitPython_SSD1327$ sudo python3 setup.py install running install running bdist_egg running egg_info creating adafruit_circuitpython_ssd1327.egg-info writing adafruit_circuitpython_ssd1327.egg-info/PKG-INFO

Unfortunately, that relies upon /displayio/, which itself does not seem be available for Linux systems. It is part of pi@rpi3bplus-1:~/scratch$ git clone

formatting link
Cloning into 'circuitpython'...

... but setup.py fails on that download

pi@rpi3bplus-1:~/scratch/circuitpython$ sudo pip3 install circuitpython-stubs Looking in indexes:

formatting link
formatting link
Collecting circuitpython-stubs Downloading
formatting link
Installing collected packages: circuitpython-stubs Successfully installed circuitpython-stubs-2019.7.7 pi@rpi3bplus-1:~/scratch/circuitpython$ sudo python3 setup.py install running install running bdist_egg running egg_info writing circuitpython_stubs.egg-info/PKG-INFO writing dependency_links to circuitpython_stubs.egg-info/dependency_links.txt writing top-level names to circuitpython_stubs.egg-info/top_level.txt error: package directory 'circuitpython-stubs' does not exist pi@rpi3bplus-1:~/scratch/circuitpython$

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

Ok, my apologies, as I could NOT install the micropython-ssd1327-1.0.0 library because after I DID install micropython from here:

formatting link

I received the said error about no module called micropython

No I did not invoke as I didn't know that it had to be

It looks like the Adafruit_CircuitPython_SS1327 library can't be installed then, and the micropython-ssd1327-1.0.0 library can't be used due to micropython not being invoked???

It now seems that the said oled display can't be used with a raspberry pi, as it needs the ssd1327 library.

Thanks

Reply to
RobH

On Wed, 18 Dec 2019 20:57:34 +0000, RobH declaimed the following:

Okay, if you built micropython, and the test (section 4) runs, I'd think the next move would be to follow step 5 to install the micropython package.

The Adafruit library requires /displayio/ but on Linux the adafruit_blinka interface library only provides

""" This repository contains a selection of packages mirroring the CircuitPython API on hosts running micropython. Working code exists to emulate the CircuitPython packages;

board - breakout-specific pin identities microcontroller - chip-specific pin identities digitalio - digital input/output pins, using pin identities from board+microcontroller packages bitbangio - software-driven interfaces for I2C, SPI busio - hardware-driven interfaces for I2C, SPI, UART time * - substitute functions monkey-patched to time module """ ... No displayio (nor many of the libraries shown

formatting link
)

Micropython requires you to invoke it explicitly:

/micropython

I don't have the display to fully illustrate, but...

formatting link
and
formatting link

... gave me

pi@rpi3bplus-1:~$ sudo apt install python3-dev libfreetype6-dev libjpeg-dev build-essential libopenjp2-7 libtiff5 Reading package lists... Done Building dependency tree Reading state information... Done build-essential is already the newest version (12.6). The following NEW packages will be installed: libjpeg-dev libjpeg62-turbo-dev

0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 236 kB of archives. After this operation, 543 kB of additional disk space will be used. Do you want to continue? [Y/n] Get:1
formatting link
buster/main armhf Setting up libjpeg-dev (1:1.5.2-2) ... pi@rpi3bplus-1:~$ pip3 install --upgrade luma.oled Looking in indexes:
formatting link
formatting link
Collecting luma.oled Downloading
formatting link
Collecting luma.core>=1.12.0 (from luma.oled) Downloading
formatting link
(51kB)

Requirement already satisfied, skipping upgrade: spidev; platform_system == "Linux" in /usr/local/lib/python3.7/dist-packages (from luma.core>=1.12.0->luma.oled) (3.4) Installing collected packages: luma.core, luma.oled Successfully installed luma.core-1.12.0 luma.oled-3.3.0 pi@rpi3bplus-1:~$ python3 Python 3.7.3 (default, Apr 3 2019, 05:39:12) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

Looks to me like the display is feasible (the usage page didn't list the 1327, but imported 1306, 1309, 1325, 13331, and sh1106 -- I took a chance specifying 1327, and it took without error) {I've now uninstalled since, as stated, I don't have the display, so why clutter SD card}

Obviously, you'll need to follow the luma.oled API to use the display.

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

Thanks for that. I already had some of the files installed from a previous attempt. In the luma.examples/examples folder, I edited the clock.py script to include:

from luma.core.interface.serial import i2c, spi from luma.core.render import canvas from luma.oled.device import ssd1306, ssd1309, ssd1325, ssd1331, sh1106

but edited the last line to just from luma.oled.device import ssd1327.

When I ran the script : pi@raspberrypi:~/luma.examples/examples $ python clock.py Version: luma.oled 3.3.0 (luma.core 1.12.0) Display: ssd1306 Interface: i2c Dimensions: 128 x 64

and there was no errors and nothing on the display.

Reply to
RobH

On Thu, 19 Dec 2019 09:44:29 +0000, RobH declaimed the following:

Sorry -- we are now beyond what I can investigate (no display here with which to test).

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.