Code: Select all
__init__.py
Code: Select all
aioble.py
Code: Select all
>>> import aioble.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "aioble.py", line 6, in <module>
ImportError: can't perform relative import
Code: Select all
__init__.py
Code: Select all
aioble.py
Code: Select all
>>> import aioble.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "aioble.py", line 6, in <module>
ImportError: can't perform relative import
Finally got it all working. Thanks for your interest and help. I *was sure* I have tried this before, but here is what worked this time.davef wrote: ↑Thu Oct 21, 2021 7:04 amWhen the files are copied to /pyboard/
then you should be able to do:Then we can deal with the errors that arise from that.Code: Select all
cd /pyboard repl Ctrl-D import aioble
Code: Select all
/pyboard> mkdir aioble
cp /opt/micropython-lib/micropython/bluetooth/aioble/aioble/* ./aioble
/pyboard> repl
Entering REPL. Use Control-X to exit.
>
MicroPython v1.17 on 2021-09-02; ESP32 module with ESP32
Type "help()" for more information.
>>>
>>> import aioble
>>>
Code: Select all
cp /opt/micropython-lib/micropython/bluetooth/aioble/aioble/* ./aioble
/pyboard> repl
Code: Select all
cp /opt/micropython-lib/micropython/bluetooth/aioble/aioble/* /pyboard/aioble/> repl
Code: Select all
cd /pyboard
cp /opt/micropython-lib/micropython/bluetooth/aioble/aioble/* ./aioble
Code: Select all
cp /opt/micropython-lib/micropython/bluetooth/aioble/aioble/* /pyboard/aioble
Sorry for the delay in replying. This is exactly what I was doing. I was already indhylands wrote: ↑Thu Oct 21, 2021 6:03 pmI think that the first command assumed that the current directory was /pyboard.
Using /pyboard/aioble eliminates the current directory from the equation (i.e. it will work regardless of the current directory is).
And to be clear, I'm saying that this:is equivalent toCode: Select all
cd /pyboard cp /opt/micropython-lib/micropython/bluetooth/aioble/aioble/* ./aioble
The first example that shows /pyboard> repl on the second line is showing the prompt (/pyboard>) followed by a command (repl).Code: Select all
cp /opt/micropython-lib/micropython/bluetooth/aioble/aioble/* /pyboard/aioble
The second example has an extraneous /> repl at the end of the line which shouldn't be there.
Code: Select all
/pyboard
Code: Select all
./aioble
Code: Select all
/pyboard/aioble