Closed jamey closed 4 years ago
Thanks for submitting this issue, looks like the remove_pip_package function is indeed missing from /opt/netperf/scriptutils.sh
I'll add that function, in the mean time a workaround for switching from speedtest-cli
to Ookla's speedtest client is:
speedtest-cli
:
sudo pip3 uninstall speedtest-cli
sudo /opt/netperf/setup.sh
After running the setup script the client setting in the speedtest section of /opt/netperf/config/netperf.json should be: "client": "ookla"
Chris
Unfortunately, that does not work. The uninstall fails.
Not uninstalling speedtest-cli at /usr/lib/python3/dist-packages, outside environment /usr Can't uninstall 'speedtest-cli'. No files were found to uninstall.
These are the files in that location.
ls -hald *speed*
drwxr-xr-x 2 root root 4.0K Aug 8 05:01 speedtest_cli-2.0.2.egg-info
-rw-r--r-- 1 root root 61K Jul 14 17:52 speedtest.py
I archived off that file and directory, speedtest-cli no longer shows as installed. Running install_packages.sh prompts me to choose a speed test app, I choose Ookla, then it says it will launch the Ookla app so I can accept the license. That does not happen, the script exits and outputs the following.
Traceback (most recent call last):
File "/usr/bin/speedtest", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3191, in <module>
@_call_aside
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3175, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 583, in _build_master
ws.require(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'speedtest-cli==2.0.2' distribution was not found and is required by the application
All required packages were installed successfully.
I've reverted the changes I made, and the system is back to operating as before.
I've added the missing remove_pip_package function, I can now switch between the speedtest-cli and Ookla clients by running the package installer script and then updating the speedtest client setting in netperf.json (either 'speedtest-cli' or 'ookla')
On an installed system, when invoking install_packages.sh to change from the opensource speed test CLI to the Ookla one, the script fails with this output.
Removing speedtest-cli client... /home/pi/network_performance_monitor/install_packages.sh: line 99: remove_pip_package: command not found Adding Ookla repository...
From this point, the script does not install the Ookla CLI and continues to use the open source one.