Raspberry Pi SDK setup problems

So I tried to follow the SDK setup for the Raspberry Pi. I cloned the GitHub repository in the terminal and navigated to the sphero-sdk=raspberrypi-python dir. But when I try to type cd pi_dependencies/ it says there is no such dir.
I’ve tried this several times but I keep getting the same error.

Thanks
Richard

1 Like

Those are old instructs and don’t work with the latest version. Read the GitHub page for the correct info.
You will also need pyserial and pyserial-asyncio in addition to asyncio in your python environment.

1 Like

@codingheroes - Have you followed the suggestions in the following posts?

3 Likes

The info on the GitHub page doesn’t really help. It just says to follow the instructions on the same setup page I have been using.

1 Like

Hey Richard!

I think you might be following outdated instructions. There is no pi_dependencies directory in the sphero-sdk-raspberrypi-python repo (hence why your computer can’t find it); when you type ls in the terminal when you are in the sphero-sdk-raspberrypi-python repo you cloned, what structure does it show you?

Is this the info you have been using to install dependencies?

You should be running the first_time_setup.sh script in the root folder to install dependencies. This link should walk you through how :slight_smile:

Please let me know if those instructions don’t help!

Kelsey

1 Like

I’m still having the same issues as the OP. 18%20AM

2 Likes

When I created the virtual environment, I get (pi) instead of (raspberry-pi), can someone kindly please help me with what I’m doing wrong?

27%20AM

Hey @ggtechteacher!

I am sorry that this process has proven to be a bit painful; we are working on some processes to make it easier.

In the meantime, to answer a few of your questions…
It should be fine that you are getting “pi” instead of “raspberry-pi” for your vm; that is likely just due to how your machine (Raspberry Pi) identifies itself.

In your initial screenshot (thank you so much for adding screenshots) it looks like you do have the correct version of the repo on your machine (yay!) (which also means that you won’t have a pi_dependencies directory, if you are having the exact same issue as the OP). Because you’ve been able to access the repo you cloned before (I can see it higher up in your second screenshot), that final error with cding into the repo is likely just that your sphero-sdk-raspberrypi-python folder isn’t directly within the level you are at in the last line of your terminal (it also looks like you are trying to cd into …rry-py…, instead of …rrypi-py…, so that could be one of the issues :slight_smile: ).

Let me know if any of that helps!

Kelsey

1 Like

Also, I was never able to get the chmod +x piedependencies to work (@5:01) which then affected my ./pidependencies.sh to work…Suggestions? Or does this not matter now?

1 Like

This is what I’m getting when I try to run a script:
(pi) pi@raspberrypi:~ $ /sphero-sdk-raspberrypi-python/getting_started/asyncio/leds/set_multiple_leds.py
bash: /sphero-sdk-raspberrypi-python/getting_started/asyncio/leds/set_multiple_leds.py: Permission denied
02%20PM

This is what I get when running it via the terminal on my mac:
pi@raspberrypi : ~/sphero-sdk-raspberrypi-python/getting_started/asyncio/leds $ python set_all_leds.py

File “set_all_leds.py”, line 21

async def main():

^

SyntaxError: invalid syntax

pi@raspberrypi : ~/sphero-sdk-raspberrypi-python/getting_started/asyncio/leds $

1 Like

You need to be in your sphero-sdk-raspberrypi-python directory when you execute pipenv --python /usr/bin/python3.7 as it uses the Pipfile in this directory. I would also suggest that the docs should be updated to say “git clone https://the-url-you-just-copied.com rvr” so that a directory called rvr is created with the git files in it rather than the ridiculousy long sphero-sdk-raspberrypi-python directory. You can use “pipenv --rm” in your pi home directory to remove the environment you created there if you wish, After creating the new environment in the sphero… directory don’t forget to do the “pipenv install” and " pipenv shell" commands before trying a script.

1 Like

The name of the virtual environment in brackets, (pi) in your case, indicates the directory you were in when you created it by the way.

2 Likes

I’m hoping this is means progress…thanks for your help so far

pi@raspberrypi : ~ $ cd /home/pi/sphero-sdk-raspberrypi-python/

pi@raspberrypi : ~/sphero-sdk-raspberrypi-python $ pipenv --python /usr/bin/python3.7

Creating a virtualenv for this project…

Pipfile: /home/pi/sphero-sdk-raspberrypi-python/Pipfile

Using /usr/bin/python3.7 (3.7.3) to create virtualenv…

⠇ Creating virtual environment…Already using interpreter /usr/bin/python3.7

Using base prefix ‘/usr’

New python executable in /home/pi/.local/share/virtualenvs/sphero-sdk-raspberrypi-python-M5SuJw2V/bin/python3.7

Also creating executable in /home/pi/.local/share/virtualenvs/sphero-sdk-raspberrypi-python-M5SuJw2V/bin/python

Installing setuptools, pip, wheel…

done.

Running virtualenv with interpreter /usr/bin/python3.7

:heavy_check_mark: Successfully created virtual environment!

Virtualenv location: /home/pi/.local/share/virtualenvs/sphero-sdk-raspberrypi-python-M5SuJw2V

pi@raspberrypi : ~/sphero-sdk-raspberrypi-python $ pipenv install

Pipfile.lock not found, creating…

Locking [dev-packages] dependencies…

Locking [packages] dependencies…

⠹ Locking…

But what about the files themselves? Saying that line 22 has invalid syntax?
pi@raspberrypi : ~/sphero-sdk-raspberrypi-python/getting_started/asyncio $ cd /home/pi/sphero-sdk-raspberrypi-python/getting_started/asyncio/leds/

pi@raspberrypi : ~/sphero-sdk-raspberrypi-python/getting_started/asyncio/leds $ python set_multiple_leds_with_rest_api.py

File “set_multiple_leds_with_rest_api.py”, line 22

async def main():

^

SyntaxError: invalid syntax

pi@raspberrypi : ~/sphero-sdk-raspberrypi-python/getting_started/asyncio/leds $

1 Like

Is that after pipenv install has completed successfully? And did you then do pipenv shell?

1 Like

Judging by your command prompt you have not done pipenv shell as it should have (sphero…) at the start.

1 Like

what worked for me
when I connect to my raspberry pi using ssh from my mac computer
/home/pi is where I end up
That is the directory where I ran all the programs
including . pipenv install, pipenv shell

I did notice the command python --version did not return . version 3.7 when I was in difference directores

1 Like

When I run the program, I get this:
Traceback (most recent call last):
File “/home/pi/sphero-sdk-raspberrypi-python/getting_started/asyncio/leds/set_all_leds.py”, line 6, in
from sphero_sdk import SpheroRvrAsync
File “/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/init.py”, line 33, in
from sphero_sdk.asyncio.client.dal.serial_async_dal import SerialAsyncDal
File “/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/client/dal/serial_async_dal.py”, line 5, in
from sphero_sdk.asyncio.server import SerialSpheroPort, Parser, Handler
File “/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/server/init.py”, line 4, in
from .port.serial_sphero_port import SerialSpheroPort
File “/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/server/port/serial_sphero_port.py”, line 6, in
from serial_asyncio import SerialTransport
ModuleNotFoundError: No module named ‘serial_asyncio’

Can someone please kindly translate this for me? Thanks

1 Like

pi@raspberrypi:~ pipenv install Warning: Your Pipfile requires python_version 2.7, but you are using 3.7.3 (/home/pi/.local/share/v/p/bin/python). pipenv --rm and rebuilding the virtual environment may resolve the issue.
pipenv check will surely fail. Pipfile.lock not found, creating... Locking [dev-packages] dependencies... Locking [packages] dependencies... Updated Pipfile.lock (dfae9f)! Installing dependencies from Pipfile.lock (dfae9f)... 🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00 To activate this project's virtualenv, run pipenv shell. Alternatively, run a command inside the virtualenv with pipenv run. pi@raspberrypi:~ pipenv shell
Warning: Your Pipfile requires python_version 2.7, but you are using 3.7.3 (/home/pi/.local/share/v/p/bin/python).
pipenv --rm and rebuilding the virtual environment may resolve the issue. pipenv check will surely fail.
Launching subshell in virtual environment…
. /home/pi/.local/share/virtualenvs/pi-V9tpwFal/bin/activate
pi@raspberrypi:~ . /home/pi/.local/share/virtualenvs/pi-V9tpwFal/bin/activate (pi) pi@raspberrypi:~ /sphero-sdk-raspberrypi-python/getting_started/asyncio/leds
bash: /sphero-sdk-raspberrypi-python/getting_started/asyncio/leds: Is a directory
(pi) pi@raspberrypi:~ cd /sphero-sdk-raspberrypi-python/getting_started/asyncio/leds (pi) pi@raspberrypi:/sphero-sdk-raspberrypi-python/getting_started/asyncio/leds python set_all_leds.py
Traceback (most recent call last):
File “set_all_leds.py”, line 6, in
from sphero_sdk import SpheroRvrAsync
File “/sphero-sdk-raspberrypi-python/sphero_sdk/init.py”, line 27, in
from sphero_sdk.asyncio.client.firmware.rvr_fw_check_async import RvrFwCheckAsync
File “/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/client/firmware/rvr_fw_check_async.py”, line 4, in
from sphero_sdk.common.firmware.cms_fw_check_base import CmsFwCheckBase
File “/sphero-sdk-raspberrypi-python/sphero_sdk/common/firmware/cms_fw_check_base.py”, line 2, in
import aiohttp
ModuleNotFoundError: No module named ‘aiohttp’
(pi) pi@raspberrypi:/sphero-sdk-raspberrypi-python/getting_started/asyncio/leds $