ImportError: No module named pyb
ImportError: No module named pyb
I was under the impression the pyb module came standard on the pyboard? I started it up this morning (for the first time mind you), and the root directly appeared without a problem after installing the new driver software I was able to view and execute the internal scripts (main.py and boot.py). I'm interested in using an external I2C, so I started with "from pyb import I2C" of course, but it generates an error immediately (same as subject line). Can someone direct me if I'm misunderstanding something The import command was obviously taken from https://docs.micropython.org/en/latest/ ... b.I2C.html
Re: ImportError: No module named pyb
Which pyboard and which firmware are you using. You get the information py pushing Ctrl-B at the REPL prompt.
Re: ImportError: No module named pyb
Is it required to use a REPL terminal? The Pyboard is going to be monitored through a Raspberry Pi (the pyboard is plugged into it) so I had just navigated to the pyboard thru the RPi, edited the main.py from there and ran in thru the python terminal that is already on Rasbian. I'm wondering if this is my problem? General code seems to run fine but importing does not.
I will be home shortly to answer your original question if I can
I will be home shortly to answer your original question if I can
Re: ImportError: No module named pyb
There is no need for a specific terminal, just some means to pick up the messages sent by the pyboard through its cdc interface, the same path which told you the error messages.
Re: ImportError: No module named pyb
So running from a .py file and using the terminal that opens (where the exception was written and has lines like a REPL terminal (>>>)) is not the same thing. I'm working on how to open REPL on a Raspberry Pi right now. Sorry for the delay
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: ImportError: No module named pyb
the program yon need for REPL on raspberry pi is screen. Download and install it by typing
To enter a REPL session type
To exit press CTRL+A, \, then answer yes to the question. Pressing CTRL+A, CTRL+D gets you back to a command prompt, but you haven't terminated screen. You've detached from screen to reattatch and terminate properly type
Code: Select all
sudo apt-get screen
Code: Select all
screen /dev/ttyACM0
Code: Select all
screen -r
Re: ImportError: No module named pyb
Hello,
I have the same question.
My Pyboard :
MicroPython v1.10-227-g696549d2e on 2019-03-16; PYBv1.1 with STM32F405RG
Type "help()" for more information.
>>>
I have the same question.
My Pyboard :
MicroPython v1.10-227-g696549d2e on 2019-03-16; PYBv1.1 with STM32F405RG
Type "help()" for more information.
>>>