This continues from topic #9466, "Hands On ROS - Chap 6 - Pt 1 - “Ubuntu 18.04 on Pi for ROS1”.
Brief Recap: In the last part, I had difficulty locating the Ubuntu MATE 18.04 image specified in handsonros. When the image was finally located, I found that it would not run on my Raspis’ (all were model 3 B+). I got similar run failures for Ubuntu MATE 16.04 and Ubuntu MATE 20.04 and also for Ubuntu 18.04 server. I also tried images for Ubuntu server (16.04, 18.04, 20.04) but only the image for Ubuntu 20.04 server worked.
This Topic:
With the Ubuntu 20.04 server image running on my Raspi 3 B+, I then ran into problems with this command on p172 of #handsonros:
$ curl -kL dexterindustries.com/update_gopigo3 | bash
I posted some of this in two different topics. The first was topic #9471, “Does GoPiGo3 still really need Python 2?” and the second was topic #9472, “Documentation for update_gopigo3.sh and related scripts?”. In topic #9471, I was merely wondering why Python 2 was being installed. In topic #9472, I was bamboozled by the functioning of the update_gopigo3.sh script and how to prevent it from installing the desktop (since I was running a server image). @cyclicalobsessive replied with some great info which led me to the “Minimal Installation” page.
With a fresh Ubuntu 20.04 server image running on my Raspi 3 B+, I used this Minimal Installation command:
$ curl -kL dexterindustries.com/update_gopigo3 | bash -s – --bypass-gui-installation
This time, as expected, the desktop was not installed but I got some errors. The log is provided below. The errors (or other noteworthy entries) are indicated in bold and they all arise from “https://github.com/DexterInd/RFR_Tools/blob/master/scripts/install_tools.sh” (which update_gopigo3.sh runs).
The first error relates to nodejs not being available for Ubuntu 20.04, aka “Focal Fossa” but this link suggests it is available. Looks like a scripting failure in the way it detects Ubuntu versions? What is the fix?
The second error relates to package “python-pip”. See here for what Debian says. Not clear if it actually exists as a binary but the python3-pip binary (built from python-pip source code) does exist. Why does the shell script not use python3-pip?
The third error relates to this code (from install_tools.sh, referenced above):
echo "Installing python package for RFR_Tools "
# installing the package itself
pushd $RFRTOOLS/miscellaneous > /dev/null
install_python_packages
popd > /dev/null
Which calls “install_python_packages”:
install_python_packages() {
[[ $systemwide = “true” ]] && sudo python2 setup.py install \
&& [[ $usepython3exec = “true” ]] && sudo python3 setup.py install
[[ $userlocal = “true” ]] && python2 setup.py install --user \
&& [[ $usepython3exec = “true” ]] && python3 setup.py install --user
[[ $envlocal = “true” ]] && python2 setup.py install \
&& [[ $usepython3exec = “true” ]] && python3 setup.py install
}
[BTW, this conditional logic is very hard to read and therefore comprehend - I am not a shell script maven but can’t this be simplified?]
Which, in turn, calls RFR_Tools\miscellaneous\setup.py
The third error occurs therein, at line 18 (“import setuptools”). What and where is “setuptools”?
The fourth error states “Executable “pip2” couldn’t be found.” Does this relate to the above “python-pip” error?
Any advice @cleoqc, @cyclicalobsessive, @jimrh, @KeithW, others?
I would, at this point, like to voice great frustration with these shell scripts. I understand why they were created but they are complex and inherently fragile things. Even small deviations from the assumptions made by the developer who writes the scripts will cause failure. So, is there any official (Modular Robotics / Dexter Industries) documentation on how to manually (not using shell scripts) install the minimum drivers and supporting code dependencies to allow easygopigo3 python scripts to work on “adjacent” Debian distros like Ubuntu for ROS work? If not, can / should such documentation be created to provide for less fragile ways to have GoPiGo3 work with ROS?
I know Modular Robotics / Dexter Industries did not write handsonros. However, that book does assert one can do ROS on GoPiGo. Increasingly, it seems to me that one needs EITHER some special experience held by few people (@Christian, @brjapon, @cyclicalobsessive, @KeithW, others?) OR ONE needs a time machine back to 2020.
----- Begin update_gopigo3 Log -----
pi@Ubuntu-20-04-Pi3:~$ curl -kL dexterindustries.com/update_gopigo3 | bash -s – --bypass-gui-installation
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 251 100 251 0 0 1568 0 --:–:-- --:–:-- --:–:-- 1568
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
100 12810 100 12810 0 0 13818 0 --:–:-- --:–:-- --:–:-- 13818
Welcome to GoPiGo3 Installer.
Updating GoPiGo3 for master branch with the following options:
–no-dependencies=false
–no-update-aptget=false
–bypass-rfrtools=false
–bypass-python-rfrtools=false
–bypass-gui-installation=true
–user-local=false
–env-local=false
–system-wide=trueUsing “master” branch
Options used for RFR_Tools script: “–system-wide master --use-python3-exe-too --update-aptget --install-deb-deps --install-python-package”
Installing RFR_Tools. This might take a while…
Updating RFR_Tools for master branch with the following options:
–install-python-package=true
–system-wide=true
–user-local=false
–env-local=false
–use-python3-exe-too=true
–update-aptget=true
–install-deb-deps=true
–install-gui=false
[sudo] password for pi:
Installing script_tools.
Done installing script_tools
installing python2
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python2-minimal python2.7 python2.7-minimal
Suggested packages:
python2-doc python-tk python2.7-doc binutils binfmt-support
The following NEW packages will be installed:
libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python2 python2-minimal python2.7 python2.7-minimal
0 upgraded, 7 newly installed, 0 to remove and 1 not upgraded.
Need to get 3544 kB of archives.
After this operation, 14.6 MB of additional disk space will be used.
Get:1 Index of /ubuntu-ports focal-updates/universe armhf libpython2.7-minimal armhf 2.7.18-1~20.04.3 [335 kB]
Get:2 Index of /ubuntu-ports focal-updates/universe armhf python2.7-minimal armhf 2.7.18-1~20.04.3 [1086 kB]
Get:3 Index of /ubuntu-ports focal/universe armhf python2-minimal armhf 2.7.17-2ubuntu4 [27.5 kB]
Get:4 Index of /ubuntu-ports focal-updates/universe armhf libpython2.7-stdlib armhf 2.7.18-1~20.04.3 [1813 kB]
Get:5 Index of /ubuntu-ports focal-updates/universe armhf python2.7 armhf 2.7.18-1~20.04.3 [248 kB]
Get:6 Index of /ubuntu-ports focal/universe armhf libpython2-stdlib armhf 2.7.17-2ubuntu4 [7072 B]
Get:7 Index of /ubuntu-ports focal/universe armhf python2 armhf 2.7.17-2ubuntu4 [26.5 kB]
Fetched 3544 kB in 1s (2649 kB/s)
Selecting previously unselected package libpython2.7-minimal:armhf.
(Reading database … 100870 files and directories currently installed.)
Preparing to unpack …/0-libpython2.7-minimal_2.7.18-1~20.04.3_armhf.deb …
Unpacking libpython2.7-minimal:armhf (2.7.18-1~20.04.3) …
Selecting previously unselected package python2.7-minimal.
Preparing to unpack …/1-python2.7-minimal_2.7.18-1~20.04.3_armhf.deb …
Unpacking python2.7-minimal (2.7.18-1~20.04.3) …
Selecting previously unselected package python2-minimal.
Preparing to unpack …/2-python2-minimal_2.7.17-2ubuntu4_armhf.deb …
Unpacking python2-minimal (2.7.17-2ubuntu4) …
Selecting previously unselected package libpython2.7-stdlib:armhf.
Preparing to unpack …/3-libpython2.7-stdlib_2.7.18-1~20.04.3_armhf.deb …
Unpacking libpython2.7-stdlib:armhf (2.7.18-1~20.04.3) …
Selecting previously unselected package python2.7.
Preparing to unpack …/4-python2.7_2.7.18-1~20.04.3_armhf.deb …
Unpacking python2.7 (2.7.18-1~20.04.3) …
Selecting previously unselected package libpython2-stdlib:armhf.
Preparing to unpack …/5-libpython2-stdlib_2.7.17-2ubuntu4_armhf.deb …
Unpacking libpython2-stdlib:armhf (2.7.17-2ubuntu4) …
Setting up libpython2.7-minimal:armhf (2.7.18-1~20.04.3) …
Setting up python2.7-minimal (2.7.18-1~20.04.3) …
Linking and byte-compiling packages for runtime python2.7…
Setting up python2-minimal (2.7.17-2ubuntu4) …
Selecting previously unselected package python2.
(Reading database … 101619 files and directories currently installed.)
Preparing to unpack …/python2_2.7.17-2ubuntu4_armhf.deb …
Unpacking python2 (2.7.17-2ubuntu4) …
Setting up libpython2.7-stdlib:armhf (2.7.18-1~20.04.3) …
Setting up python2.7 (2.7.18-1~20.04.3) …
Setting up libpython2-stdlib:armhf (2.7.17-2ubuntu4) …
Setting up python2 (2.7.17-2ubuntu4) …
Processing triggers for man-db (2.9.1-1) …
Processing triggers for mime-support (3.64ubuntu1) …
Updating debian repository within RFR_Tools
RFR_Tools: Couldn’t add Nodejs repo to source because it’s not available for “focal” distribution
Hit:1 Index of /ubuntu-ports focal InRelease
Hit:2 Index of /ubuntu-ports focal-updates InRelease
Hit:3 Index of /ubuntu-ports focal-backports InRelease
Hit:4 Index of /ubuntu-ports focal-security InRelease
Reading package lists… Done
Installing debian dependencies within RFR_Tools. This might take a while…
Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, selecting ‘python-dev-is-python2’ instead of ‘python-dev’
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pipE: Package ‘python-pip’ has no installation candidate
Cloning RFR Tools
Done Cloning RFR Tools
Removing “auto_detect_rpi” to make space for the new one
Installing python package for RFR_Tools
Traceback (most recent call last):
..File “setup.py”, line 18, in <module>
....import setuptools
ImportError: No module named setuptools
Done installing RFR_Tools library
Done installing RFR_Tools
Executable “pip2” couldn’t be found. Error occurred with RFR_Tools installation.
pi@Ubuntu-20-04-Pi3:~$
----- End update_gopigo3 Log -----
Note: After the running of update_gopigo3.sh, I checked the following versions (in case it is useful):
Output of “python2 --version” and “python3 --version” are “Python 2.7.18” and “Python 3.8.10”, resp.
Output of “pip --version” is “Command ‘pip’ not found, but can be installed with: sudo apt install python3-pip”.