Getting Started with Raspberry Pi Pico

I’ve just shared a new tutorial: “Getting Started with Raspberry Pi Pico”


5 Likes

Perfect timing!

1 Like

It’s also the perfect time for me, becaus I just got two Raspberry Pi picos.

2 Likes

Trying to get rshell installed and having problems. I installed python on windows 10 and seems to be working fine. When I use powershell and do the command:
pip install rshell
I get:
Requirement already satisfied: rshell in c:\users\rob\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (0.0.28)
Requirement already satisfied: pyserial in c:\users\rob\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from rshell) (3.5)
Requirement already satisfied: pyudev>=0.16 in c:\users\rob\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from rshell) (0.22.0)
Requirement already satisfied: pyreadline in c:\users\rob\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from rshell) (2.1)
Requirement already satisfied: six in c:\users\rob\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from pyudev>=0.16->rshell) (1.15.0)

It doesn’t actually create an executable. Help or advice? Thanks!

1 Like

Can you start an rshell session? Looks like it might already be installed.

1 Like

No - rshell returns:

rshell : The term ‘rshell’ is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • rshell
  •   + CategoryInfo          : ObjectNotFound: (rshell:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

Have tried finding rshell.exe on the machine in case it is simply a path error but no luck.

1 Like

Hi Rob,

Do you have multiple versions of python installed? pip might be associated with the wrong python version - hence the issues.

See here for a possible solution:

1 Like

Hi all! I received my Pico boards this morning and have been setting up python to start working on some programming. Python and Pip seem to be installed correctly but every time I type rshell -V after installing I get these errors:

Traceback (most recent call last):
** File “C:\Program Files\Python310\Scripts\rshell-script.py”, line 33, in **
** sys.exit(load_entry_point(‘rshell==0.0.31’, ‘console_scripts’, ‘rshell’)())**
** File “C:\Program Files\Python310\Scripts\rshell-script.py”, line 25, in importlib_load_entry_point**
** return next(matches).load()**
** File “C:\Program Files\Python310\lib\importlib\metadata_init_.py”, line 162, in load**
** module = import_module(match.group(‘module’))**
** File “C:\Program Files\Python310\lib\importlib_init_.py”, line 126, in import_module**
** return _bootstrap._gcd_import(name[level:], package, level)**
** File “”, line 1050, in _gcd_import**
** File “”, line 1027, in _find_and_load**
** File “”, line 1006, in _find_and_load_unlocked**
** File “”, line 688, in _load_unlocked**
** File “”, line 883, in exec_module**
** File “”, line 241, in _call_with_frames_removed**
** File “C:\Program Files\Python310\lib\site-packages\rshell\command_line.py”, line 1, in **
** import rshell.main**
** File “C:\Program Files\Python310\lib\site-packages\rshell\main.py”, line 80, in **
** import readline**
** File “C:\Users\AppData\Roaming\Python\Python310\site-packages\readline.py”, line 34, in **
** rl = Readline()**
** File “C:\Users\AppData\Roaming\Python\Python310\site-packages\pyreadline\rlmain.py”, line 422, in init**
** BaseReadline.init(self)**
** File “C:\Users\AppData\Roaming\Python\Python310\site-packages\pyreadline\rlmain.py”, line 62, in init**
** mode.init_editing_mode(None)**
** File “C:\Users\AppData\Roaming\Python\Python310\site-packages\pyreadline\modes\emacs.py”, line 633, in init_editing_mode**
** self._bind_key(‘space’, self.self_insert)**
** File “C:\Users\AppData\Roaming\Python\Python310\site-packages\pyreadline\modes\basemode.py”, line 162, in _bind_key**
** if not callable(func):**
** File “C:\Users\AppData\Roaming\Python\Python310\site-packages\pyreadline\py3k_compat.py”, line 8, in callable**
** return isinstance(x, collections.Callable)**
AttributeError: module ‘collections’ has no attribute 'Callable’

I am unsure what I am doing wrong? I have searched all over google and tried these following methods:

  1. Reinstall Python and Pip
  2. Make sure path is set during install
  3. Installed system wide for all users
  4. Disable 256 Character limit
  5. Set environment variables in my Path directory to where my python scripts are
  6. Running powershell as admin (because I kept receiving this error when trying to overwrite files: Defaulting to user installation because normal site-packages is not writeable)
  7. Specified version numbers (e.g. “pip3 install rshell”)

It also doesn’t install the same as shown in the Core Electronics rshell tutorial…

Sorry for such a long post but I’m quite amateur at Python and I’m honestly stumped to what I’m doing wrong?

2 Likes

Lol so I actually found out how to fix it, was going to delete this thread but thought I’d share the answer for anyone in the same boat because this was a pain in the butt.

So for starters I should’ve read the error better but to fix it all you have to do is navigate to the pyreadline folder in appdata then change this following line in the file py3k_compat.py:

Change “return isinstance(x, collections.Callable)” to “return isinstance(x, collections.abc.Callable)”

Then run rshell -V and the version number should now show.

3 Likes

Hi Oldmate,

Welcome to the forum!!

Thanks for sharing! Hopefully another maker can save some time with the tips you’ve provided :smiley:
PS: Nice name :laughing:

Liam.

2 Likes

Just a note regarding the LED flash routine for Pico W. Tried flashing the LED on the Pico W - no luck. The LED is no longer connected to pin 25. It is connected to the Wireless chip. To to get its address the code needs to be changed to led = machine.Pin(“LED”, machine.Pin.OUT).

3 Likes

Got me too.
The following sets the default state of the LED when defined. value=1 ON, value=0 OFF.

import machine
led = machine.Pin(“LED”, machine.Pin.OUT, value=0)

Alternative if you import only Pin

from machine import Pin
led = Pin(“LED”, Pin.OUT, value=0)

As per another thread import uses part of the 264KB SRAM memory of the RP2040, if you import too much, an exception error will be raised and the program will crash.

Cheers
Jim

3 Likes

My Pico returns “Device is busy or does not respond” after booting with micropython v 1.19,1 Also the usb port disappears after switching from boot mode to run mode. I have been following your Pico getting started video.

I have solved my own problem.
When booting the Pico from Windows 10, Thonny finds the device on port COM1
After booting, it swaps to port USB Serial Device COM 3
I go back to the interpreter option on Thonny and select COM 3,
All is then good

1 Like

Hi all, not really a reply but did not know how to add further comment.

I know this is old, but I’m just starting on the pico and having issues with rshell. Getting the following when I try to run.

Have set the path with entries for the pythoncore-3.14-64\Scripts and site-packages.

Not sure where to go from there.

All help appreciated.

Regards

Des

Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in run_code
File "C:\Users\pasco\AppData\Local\Python\pythoncore-3.14-64\Scripts\rshell.exe_main
.py", line 5, in
sys.exit(main())
~~~~^^
File “C:\Users\pasco\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\rshell\command_line.py”, line 4, in main
rshell.main.main()
~~~~~~~~~~~~~~~~^^
File “C:\Users\pasco\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\rshell\main.py”, line 3203, in main
real_main()
~~~~~~~~~^^
File “C:\Users\pasco\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\rshell\main.py”, line 3186, in real_main
shell.cmdloop(cmd_line)
~~~~~~~~~~~~~^^^^^^^^^^
File “C:\Users\pasco\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\rshell\main.py”, line 1924, in cmdloop
cmd.Cmd.cmdloop(self)
~~~~~~~~~~~~~~~^^^^^^
File “C:\Users\pasco\AppData\Local\Python\pythoncore-3.14-64\Lib\cmd.py”, line 114, in cmdloop
if readline.backend == “editline”:
^^^^^^^^^^^^^^^^
AttributeError: module ‘readline’ has no attribute ‘backend’

Hey there, @Desmond205436, and welcome to the forum, glad to have you here.

I can’t see see anything online for that exact readline.backend error, so I’d be a bit careful about assuming it’s just a PATH problem.

It looks more like rshell is starting, but then falling over inside Python’s cmd/readline handling on your Windows install. Since you’re on Python 3.14, my first suspicion would be a compatibility issue between that Python version and rshell, but I can’t verify that from here.

A good next check would be:

python --version
pip show rshell

In addition, it might be worthwhile running the below command:

pip install pyreadline3

I had a different error recently that was resolved by that update and the error messages are similar enough that I’d be curious to see if that helps.

Get back to us with the results.

Hello Jane

Thanks for the reply. Note that I had already run a “pip install pyreadline3” before getting that error. It did reduce the number of error lines I got after, but did not resolve the issue completely.

My main reason for this was to connect to the raspberry pi pico so I looked for alternatives prior to receiving the reply and tried Thonny portable. This works out of the box and does what I need, so I think I will continue with that and in future if I need Python will probably use the Raspberry Pi that I have.

Once again thanks for your reply.

Regards

Des