Python Update - Error 502: Bad Gateway Error

After upgrading my version of python (3.8 to 3.12) on my Raspberry Pi 4 B, I now have the following error when attempting to connect to my Mycodo project.

** Error 502: Bad Gateway Error**

The last 50 lines from the Mycodo frontend web log are as follows:

This is the error message I have:

pi@raspberrypi:/usr/local/bin $ journalctl -u mycodoflask | tail -n 50
Dec 16 16:28:51 raspberrypi python[2072]: top: bad pid 'None'
Dec 16 18:32:59 raspberrypi python[546]: [2023-12-16 18:32:59 +1100] [546] [INFO] Handling signal: term
Dec 16 18:32:59 raspberrypi systemd[1]: Stopping Mycodo web user interface...
Dec 16 18:33:00 raspberrypi python[1595]: [2023-12-16 18:33:00 +1100] [1595] [INFO] Worker exiting (pid: 1595)
Dec 16 18:33:01 raspberrypi python[546]: [2023-12-16 18:33:01 +1100] [546] [INFO] Shutting down: Master
Dec 16 18:33:01 raspberrypi systemd[1]: mycodoflask.service: Succeeded.
Dec 16 18:33:01 raspberrypi systemd[1]: Stopped Mycodo web user interface.
Dec 16 18:33:01 raspberrypi systemd[1]: mycodoflask.service: Consumed 1min 32.764s CPU time.
-- Boot fe8b677608bd4e0c9b61ff8a1dc61b4d --
Dec 16 18:33:11 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 16 18:33:11 raspberrypi systemd[584]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 18:33:11 raspberrypi systemd[584]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 18:33:11 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 16 18:33:11 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
-- Boot a522d140eb9d418dad4c0ff41329ce80 --
Dec 16 18:57:00 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 16 18:57:00 raspberrypi systemd[574]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 18:57:00 raspberrypi systemd[574]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 18:57:01 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 16 18:57:01 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
-- Boot 2c7906654b1a47e09460b265a03fb451 --
Dec 16 19:06:30 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 16 19:06:30 raspberrypi systemd[567]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 19:06:30 raspberrypi systemd[567]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 19:06:30 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 16 19:06:30 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
-- Boot 9db5256a3a5d4f33abeb447cb79ed323 --
Dec 16 20:37:25 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 16 20:37:25 raspberrypi systemd[549]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 20:37:25 raspberrypi systemd[549]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 20:37:25 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 16 20:37:25 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
-- Boot 47093759fdd34dbaa15cc66796025610 --
Dec 17 08:26:37 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 17 08:26:37 raspberrypi systemd[563]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 17 08:26:37 raspberrypi systemd[563]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 17 08:26:38 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 17 08:26:38 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
-- Boot e2b4a2acf8544835b973cfe879afda08 --
Dec 17 08:46:53 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 17 08:46:53 raspberrypi systemd[543]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 17 08:46:53 raspberrypi systemd[543]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 17 08:46:53 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 17 08:46:53 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
-- Boot 5c56e2db3d324b8fbe56b250141504e4 --
Dec 17 09:52:37 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 17 09:52:37 raspberrypi systemd[579]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 17 09:52:37 raspberrypi systemd[579]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 17 09:52:38 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 17 09:52:38 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
pi@raspberrypi:/usr/local/bin $ journalctl -u mycodoflask | tail -n 50
Dec 16 16:28:51 raspberrypi python[2072]: top: bad pid 'None'
Dec 16 18:32:59 raspberrypi python[546]: [2023-12-16 18:32:59 +1100] [546] [INFO] Handling signal: term
Dec 16 18:32:59 raspberrypi systemd[1]: Stopping Mycodo web user interface...
Dec 16 18:33:00 raspberrypi python[1595]: [2023-12-16 18:33:00 +1100] [1595] [INFO] Worker exiting (pid: 1595)
Dec 16 18:33:01 raspberrypi python[546]: [2023-12-16 18:33:01 +1100] [546] [INFO] Shutting down: Master
Dec 16 18:33:01 raspberrypi systemd[1]: mycodoflask.service: Succeeded.
Dec 16 18:33:01 raspberrypi systemd[1]: Stopped Mycodo web user interface.
Dec 16 18:33:01 raspberrypi systemd[1]: mycodoflask.service: Consumed 1min 32.764s CPU time.
-- Boot fe8b677608bd4e0c9b61ff8a1dc61b4d --
Dec 16 18:33:11 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 16 18:33:11 raspberrypi systemd[584]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 18:33:11 raspberrypi systemd[584]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 18:33:11 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 16 18:33:11 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
-- Boot a522d140eb9d418dad4c0ff41329ce80 --
Dec 16 18:57:00 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 16 18:57:00 raspberrypi systemd[574]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 18:57:00 raspberrypi systemd[574]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 18:57:01 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 16 18:57:01 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
-- Boot 2c7906654b1a47e09460b265a03fb451 --
Dec 16 19:06:30 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 16 19:06:30 raspberrypi systemd[567]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 19:06:30 raspberrypi systemd[567]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 19:06:30 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 16 19:06:30 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
-- Boot 9db5256a3a5d4f33abeb447cb79ed323 --
Dec 16 20:37:25 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 16 20:37:25 raspberrypi systemd[549]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 20:37:25 raspberrypi systemd[549]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 16 20:37:25 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 16 20:37:25 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
-- Boot 47093759fdd34dbaa15cc66796025610 --
Dec 17 08:26:37 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 17 08:26:37 raspberrypi systemd[563]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 17 08:26:37 raspberrypi systemd[563]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 17 08:26:38 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 17 08:26:38 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
-- Boot e2b4a2acf8544835b973cfe879afda08 --
Dec 17 08:46:53 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 17 08:46:53 raspberrypi systemd[543]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 17 08:46:53 raspberrypi systemd[543]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 17 08:46:53 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 17 08:46:53 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.
-- Boot 5c56e2db3d324b8fbe56b250141504e4 --
Dec 17 09:52:37 raspberrypi systemd[1]: Started Mycodo web user interface.
Dec 17 09:52:37 raspberrypi systemd[579]: mycodoflask.service: Failed to locate executable /var/mycodo-root/env/bin/python: No such file or directory
Dec 17 09:52:37 raspberrypi systemd[579]: mycodoflask.service: Failed at step EXEC spawning /var/mycodo-root/env/bin/python: No such file or directory
Dec 17 09:52:38 raspberrypi systemd[1]: mycodoflask.service: Main process exited, code=exited, status=203/EXEC
Dec 17 09:52:38 raspberrypi systemd[1]: mycodoflask.service: Failed with result 'exit-code'.


If I try to establish the version of python I receive the following details:

pi@raspberrypi:~ $ python -v
bash: /usr/local/bin/python3.8: No such file or directory

This is the contents of the /usr/local/bin/ directory:


pi@raspberrypi:/usr/local/bin $ dir
2to3-3.12  pig2vcd  pigs  pip3	   pip3.9     python3.12	 virtualenv
idle3.12   pigpiod  pip   pip3.12  pydoc3.12  python3.12-config

I have googled for a solution, but I cannot find a solution.

Any assistance would be great.

What does the upgrade log indicate?

Here is the 1st part of the contents of the /var/log/mycodo/mycodoupgrade.log:

[2021-12-03 20:03:52] 
[2021-12-03 20:03:52] 
[2021-12-03 20:03:52] Installed version: 8.12.8
[2021-12-03 20:03:52] Latest version: 8.12.9
[2021-12-03 20:03:52] 
[2021-12-03 20:03:52] #### Beginning Upgrade: Stage 1 of 3 ####
[2021-12-03 20:03:52] 
[2021-12-03 20:04:02] Downloading latest Mycodo version 8.12.9 to /home/pi/mycodo-8.12.9.tar.gz...Done.
[2021-12-03 20:04:02] Creating /tmp/Mycodo-8.12.9...Done.
[2021-12-03 20:04:02] Extracting /home/pi/mycodo-8.12.9.tar.gz to /tmp/Mycodo-8.12.9...Done.
[2021-12-03 20:04:02] Removing /home/pi/mycodo-8.12.9.tar.gz...Done.
[2021-12-03 20:04:02] 
[2021-12-03 20:04:02] #### Completed Upgrade Stage 1 of 3 in 10 seconds ####
[2021-12-03 20:04:02] 
[2021-12-03 20:04:02] #### Beginning Upgrade Stage 2 of 3 ####
[2021-12-03 20:04:02] 
[2021-12-03 20:04:02] RELEASE_WIPE = false
[2021-12-03 20:04:02] Found currently-installed version of Mycodo. Checking version...
[2021-12-03 20:04:04] Mycodo version found installed: 8.12.8
[2021-12-03 20:04:04] 
[2021-12-03 20:04:04] #### Beginning pre-upgrade checks ####
[2021-12-03 20:04:04] 
[2021-12-03 20:04:04] Checking Python version...
[2021-12-03 20:04:04] Python >= 3.6 found. Continuing with the upgrade.
[2021-12-03 20:04:04] All pre-upgrade checks passed. Proceeding with upgrade.
[2021-12-03 20:04:04] 
[2021-12-03 20:04:05] Upgrading Mycodo to version 8.12.9
[2021-12-03 20:04:05] 
[2021-12-03 20:04:08] Stopping the Mycodo daemon...Done.
[2021-12-03 20:04:08] Moving env directory...Done.
[2021-12-03 20:04:08] Copying databases...Done.
[2021-12-03 20:04:08] Copying flask_secret_key...Done.
[2021-12-03 20:04:08] Copying SSL certificates...Done.
[2021-12-03 20:04:08] Copying mycodo/functions/custom_functions...Done.
[2021-12-03 20:04:08] Copying mycodo/inputs/custom_inputs...Done.
[2021-12-03 20:04:08] Copying mycodo/outputs/custom_outputs...Done.
[2021-12-03 20:04:08] Copying mycodo/widgets/custom_widgets...Done.
[2021-12-03 20:04:08] Copying mycodo/user_python_code...Done.
[2021-12-03 20:04:08] Copying mycodo/mycodo_flask/static/js/user_js...Done.
[2021-12-03 20:04:08] Copying mycodo/mycodo_flask/static/css/user_css...Done.
[2021-12-03 20:04:08] Moving cameras directory...Done.
[2021-12-03 20:04:08] Moving current Mycodo intstall from /home/pi/Mycodo to /var/Mycodo-backups/Mycodo-backup-2021-12-03_20-04-02-8.12.8...Done.
[2021-12-03 20:04:08] Moving downloaded Mycodo version from /tmp/Mycodo-8.12.9 to /home/pi/Mycodo...Done.
[2021-12-03 20:04:38] 
[2021-12-03 20:04:38] #### Completed Upgrade Stage 2 of 3 in 36 seconds ####
[2021-12-03 20:04:38] 
[2021-12-03 20:04:38] #### Beginning Upgrade Stage 3 of 3 ####
[2021-12-03 20:04:38] 
[2021-12-03 20:04:38] Running post-upgrade script...
[2021-12-03 20:04:39] 
[2021-12-03 20:04:39] #### Running initialization
[2021-12-03 20:04:39] 
[2021-12-03 20:04:39] #### Creating mycodo user
[2021-12-03 20:04:39] useradd: user 'mycodo' already exists
[2021-12-03 20:04:39] The user `mycodo' is already a member of `adm'.
[2021-12-03 20:04:39] The user `mycodo' is already a member of `dialout'.
[2021-12-03 20:04:39] The user `mycodo' is already a member of `i2c'.
[2021-12-03 20:04:39] The user `mycodo' is already a member of `kmem'.
[2021-12-03 20:04:39] The user `mycodo' is already a member of `video'.
[2021-12-03 20:04:39] gpio:x:997:pi,mycodo
[2021-12-03 20:04:39] The user `mycodo' is already a member of `gpio'.
[2021-12-03 20:04:40] The user `pi' is already a member of `mycodo'.
[2021-12-03 20:04:40] The user `mycodo' is already a member of `pi'.
[2021-12-03 20:04:40] 
[2021-12-03 20:04:40] #### Compiling mycodo_wrapper
[2021-12-03 20:04:40] 
[2021-12-03 20:04:40] #### Creating symlinks to Mycodo executables
[2021-12-03 20:04:41] 
[2021-12-03 20:04:41] #### Creating files and directories
[2021-12-03 20:04:41] 
[2021-12-03 20:04:41] #### Setting permissions
[2021-12-03 20:04:43] 
[2021-12-03 20:04:43] #### Checking if swap size is 100 MB and needs to be changed to 512 MB
[2021-12-03 20:04:43] #### Swap not currently set to 100 MB. Not changing.
[2021-12-03 20:04:43] 
[2021-12-03 20:04:43] #### Updating apt repositories
[2021-12-03 20:04:44] Hit:1 http://archive.raspberrypi.org/debian bullseye InRelease
[2021-12-03 20:04:45] Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
[2021-12-03 20:04:49] Reading package lists...
[2021-12-03 20:04:49] 
[2021-12-03 20:04:49] #### Installing prerequisite apt packages and update pip
[2021-12-03 20:04:49] Reading package lists...
[2021-12-03 20:04:49] Building dependency tree...
[2021-12-03 20:04:49] Reading state information...
[2021-12-03 20:04:50] E: Unable to locate package python-cffi-backend
[2021-12-03 20:04:50] Reading package lists...
[2021-12-03 20:04:50] Building dependency tree...
[2021-12-03 20:04:50] Reading state information...
[2021-12-03 20:04:51] g++ is already the newest version (4:10.2.1-1+rpi1).
[2021-12-03 20:04:51] gawk is already the newest version (1:5.1.0-1).
[2021-12-03 20:04:51] gcc is already the newest version (4:10.2.1-1+rpi1).
[2021-12-03 20:04:51] git is already the newest version (1:2.30.2-1).
[2021-12-03 20:04:51] libffi-dev is already the newest version (3.3-6).
[2021-12-03 20:04:51] libi2c-dev is already the newest version (4.2-1+b1).
[2021-12-03 20:04:51] logrotate is already the newest version (3.18.0-2).
[2021-12-03 20:04:51] moreutils is already the newest version (0.65-1).
[2021-12-03 20:04:51] nginx is already the newest version (1.18.0-6.1).
[2021-12-03 20:04:51] python3 is already the newest version (3.9.2-3).
[2021-12-03 20:04:51] python3-dev is already the newest version (3.9.2-3).
[2021-12-03 20:04:51] python3-pylint-common is already the newest version (0.2.5-4).
[2021-12-03 20:04:51] python3-setuptools is already the newest version (52.0.0-4).
[2021-12-03 20:04:51] python3-smbus is already the newest version (4.2-1+b1).
[2021-12-03 20:04:51] rng-tools is already the newest version (5migrate1).
[2021-12-03 20:04:51] sqlite3 is already the newest version (3.34.1-3).
[2021-12-03 20:04:51] wget is already the newest version (1.21-1rpi1).
[2021-12-03 20:04:51] python3-pip is already the newest version (20.3.4-4+rpt1).
[2021-12-03 20:04:51] The following packages were automatically installed and are no longer required:
[2021-12-03 20:04:51]   libfuse2 python-is-python2
[2021-12-03 20:04:51] Use 'apt autoremove' to remove them.
[2021-12-03 20:04:52] 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[2021-12-03 20:04:53] Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
[2021-12-03 20:04:53] Requirement already satisfied: pip in /usr/local/lib/python3.9/dist-packages (21.3.1)
[2021-12-03 20:04:58] WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[2021-12-03 20:04:58] 
[2021-12-03 20:04:58] #### Installing and configuring nginx web server
[2021-12-03 20:04:58] Removed /etc/systemd/system/multi-user.target.wants/mycodoflask.service.
[2021-12-03 20:04:58] Removed /etc/systemd/system/mycodoflask.service.
[2021-12-03 20:04:59] Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install.
[2021-12-03 20:04:59] Executing: /lib/systemd/systemd-sysv-install enable nginx
[2021-12-03 20:05:01] Created symlink /etc/systemd/system/multi-user.target.wants/mycodoflask.service → /home/pi/Mycodo/install/mycodoflask.service.
[2021-12-03 20:05:01] Created symlink /etc/systemd/system/mycodoflask.service → /home/pi/Mycodo/install/mycodoflask.service.
[2021-12-03 20:05:01] 
[2021-12-03 20:05:01] #### Installing logrotate scripts
[2021-12-03 20:05:01] Mycodo logrotate script installed
[2021-12-03 20:05:01] 
[2021-12-03 20:05:01] #### Checking python 3 virtualenv
[2021-12-03 20:05:01] #### Virtualenv already exists, skipping creation
[2021-12-03 20:05:01] 
[2021-12-03 20:05:01] #### Updating pip
[2021-12-03 20:05:03] Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
[2021-12-03 20:05:03] Requirement already satisfied: pip in ./env/lib/python3.9/site-packages (21.3.1)
[2021-12-03 20:05:08] 
[2021-12-03 20:05:08] #### Installing pip requirements
[2021-12-03 20:05:10] Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
[2021-12-03 20:05:10] Requirement already satisfied: pip in ./env/lib/python3.9/site-packages (21.3.1)
[2021-12-03 20:05:12] Requirement already satisfied: setuptools in ./env/lib/python3.9/site-packages (58.2.0)
[2021-12-03 20:05:14] Collecting setuptools
[2021-12-03 20:05:15]   Using cached https://www.piwheels.org/simple/setuptools/setuptools-59.4.0-py3-none-any.whl (952 kB)
[2021-12-03 20:05:17] Installing collected packages: setuptools
[2021-12-03 20:05:17]   Attempting uninstall: setuptools
[2021-12-03 20:05:17]     Found existing installation: setuptools 58.2.0
[2021-12-03 20:05:17]     Uninstalling setuptools-58.2.0:
[2021-12-03 20:05:17]       Successfully uninstalled setuptools-58.2.0
[2021-12-03 20:05:18] Successfully installed setuptools-59.4.0
[2021-12-03 20:05:20] Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
[2021-12-03 20:05:20] Requirement already satisfied: alembic==1.7.4 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 2)) (1.7.4)
[2021-12-03 20:05:22] Collecting argparse==1.4.0
[2021-12-03 20:05:22]   Using cached https://www.piwheels.org/simple/argparse/argparse-1.4.0-py2.py3-none-any.whl (23 kB)
[2021-12-03 20:05:22] Requirement already satisfied: bcrypt==3.2.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 4)) (3.2.0)
[2021-12-03 20:05:23] Requirement already satisfied: daemonize==2.5.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 5)) (2.5.0)
[2021-12-03 20:05:24] Requirement already satisfied: distro==1.6.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 6)) (1.6.0)
[2021-12-03 20:05:24] Requirement already satisfied: email_validator==1.1.3 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 7)) (1.1.3)
[2021-12-03 20:05:25] Requirement already satisfied: filelock==3.3.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 8)) (3.3.0)
[2021-12-03 20:05:25] Requirement already satisfied: Flask==2.0.2 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 9)) (2.0.2)
[2021-12-03 20:05:26] Requirement already satisfied: Flask_Accept==0.0.6 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 10)) (0.0.6)
[2021-12-03 20:05:27] Requirement already satisfied: Flask_Babel==2.0.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 11)) (2.0.0)
[2021-12-03 20:05:27] Requirement already satisfied: Flask_Compress==1.10.1 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 12)) (1.10.1)
[2021-12-03 20:05:27] Requirement already satisfied: Flask_Limiter==1.4 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 13)) (1.4)
[2021-12-03 20:05:28] Requirement already satisfied: Flask_Login==0.5.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 14)) (0.5.0)
[2021-12-03 20:05:29] Requirement already satisfied: Flask_Marshmallow==0.14.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 15)) (0.14.0)
[2021-12-03 20:05:29] Requirement already satisfied: Flask_RESTX==0.5.1 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 17)) (0.5.1)
[2021-12-03 20:05:30] Requirement already satisfied: Flask_Session==0.4.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 18)) (0.4.0)
[2021-12-03 20:05:30] Requirement already satisfied: Flask_SQLAlchemy==2.5.1 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 19)) (2.5.1)
[2021-12-03 20:05:31] Requirement already satisfied: Flask_Talisman==0.8.1 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 20)) (0.8.1)
[2021-12-03 20:05:32] Requirement already satisfied: Flask_WTF==0.15.1 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 21)) (0.15.1)
[2021-12-03 20:05:33] Requirement already satisfied: geocoder==1.38.1 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 22)) (1.38.1)
[2021-12-03 20:05:34] Requirement already satisfied: gunicorn==20.1.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 23)) (20.1.0)
[2021-12-03 20:05:34] Requirement already satisfied: influxdb==5.3.1 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 24)) (5.3.1)
[2021-12-03 20:05:35] Requirement already satisfied: marshmallow_sqlalchemy==0.26.1 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 25)) (0.26.1)
[2021-12-03 20:05:36] Requirement already satisfied: pyro5==5.12 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 26)) (5.12)
[2021-12-03 20:05:36] Requirement already satisfied: pyserial==3.5 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 27)) (3.5)
[2021-12-03 20:05:37] Requirement already satisfied: python-dateutil==2.8.2 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 28)) (2.8.2)
[2021-12-03 20:05:37] Requirement already satisfied: requests==2.26.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 29)) (2.26.0)
[2021-12-03 20:05:40] Collecting setuptools==58.2.0
[2021-12-03 20:05:41]   Using cached https://www.piwheels.org/simple/setuptools/setuptools-58.2.0-py3-none-any.whl (946 kB)
[2021-12-03 20:05:41] Requirement already satisfied: SQLAlchemy==1.4.26 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 31)) (1.4.26)
[2021-12-03 20:05:44] Requirement already satisfied: Werkzeug==2.0.2 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 32)) (2.0.2)
[2021-12-03 20:05:45] Requirement already satisfied: WTForms==2.3.3 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements.txt (line 33)) (2.3.3)
[2021-12-03 20:05:46] Requirement already satisfied: Mako in ./env/lib/python3.9/site-packages (from alembic==1.7.4->-r /home/pi/Mycodo/install/requirements.txt (line 2)) (1.1.6)
[2021-12-03 20:05:46] Requirement already satisfied: six>=1.4.1 in /usr/lib/python3/dist-packages (from bcrypt==3.2.0->-r /home/pi/Mycodo/install/requirements.txt (line 4)) (1.16.0)
[2021-12-03 20:05:46] Requirement already satisfied: cffi>=1.1 in ./env/lib/python3.9/site-packages (from bcrypt==3.2.0->-r /home/pi/Mycodo/install/requirements.txt (line 4)) (1.15.0)
[2021-12-03 20:05:46] Requirement already satisfied: dnspython>=1.15.0 in ./env/lib/python3.9/site-packages (from email_validator==1.1.3->-r /home/pi/Mycodo/install/requirements.txt (line 7)) (2.1.0)
[2021-12-03 20:05:46] Requirement already satisfied: idna>=2.0.0 in /usr/lib/python3/dist-packages (from email_validator==1.1.3->-r /home/pi/Mycodo/install/requirements.txt (line 7)) (2.10)
[2021-12-03 20:05:46] Requirement already satisfied: itsdangerous>=2.0 in ./env/lib/python3.9/site-packages (from Flask==2.0.2->-r /home/pi/Mycodo/install/requirements.txt (line 9)) (2.0.1)
[2021-12-03 20:05:46] Requirement already satisfied: click>=7.1.2 in /usr/lib/python3/dist-packages (from Flask==2.0.2->-r /home/pi/Mycodo/install/requirements.txt (line 9)) (7.1.2)
[2021-12-03 20:05:46] Requirement already satisfied: Jinja2>=3.0 in ./env/lib/python3.9/site-packages (from Flask==2.0.2->-r /home/pi/Mycodo/install/requirements.txt (line 9)) (3.0.3)
[2021-12-03 20:05:46] Requirement already satisfied: pytz in ./env/lib/python3.9/site-packages (from Flask_Babel==2.0.0->-r /home/pi/Mycodo/install/requirements.txt (line 11)) (2021.3)
[2021-12-03 20:05:47] Requirement already satisfied: Babel>=2.3 in ./env/lib/python3.9/site-packages (from Flask_Babel==2.0.0->-r /home/pi/Mycodo/install/requirements.txt (line 11)) (2.9.1)
[2021-12-03 20:05:47] Requirement already satisfied: brotli in ./env/lib/python3.9/site-packages (from Flask_Compress==1.10.1->-r /home/pi/Mycodo/install/requirements.txt (line 12)) (1.0.9)
[2021-12-03 20:05:47] Requirement already satisfied: limits in ./env/lib/python3.9/site-packages (from Flask_Limiter==1.4->-r /home/pi/Mycodo/install/requirements.txt (line 13)) (2.0.3)
[2021-12-03 20:05:47] Requirement already satisfied: marshmallow>=2.0.0 in ./env/lib/python3.9/site-packages (from Flask_Marshmallow==0.14.0->-r /home/pi/Mycodo/install/requirements.txt (line 15)) (3.14.1)
[2021-12-03 20:05:47] Requirement already satisfied: aniso8601>=0.82 in ./env/lib/python3.9/site-packages (from Flask_RESTX==0.5.1->-r /home/pi/Mycodo/install/requirements.txt (line 17)) (9.0.1)
[2021-12-03 20:05:47] Requirement already satisfied: jsonschema in ./env/lib/python3.9/site-packages (from Flask_RESTX==0.5.1->-r /home/pi/Mycodo/install/requirements.txt (line 17)) (4.2.1)
[2021-12-03 20:05:47] Requirement already satisfied: cachelib in ./env/lib/python3.9/site-packages (from Flask_Session==0.4.0->-r /home/pi/Mycodo/install/requirements.txt (line 18)) (0.4.1)
[2021-12-03 20:05:47] Requirement already satisfied: future in ./env/lib/python3.9/site-packages (from geocoder==1.38.1->-r /home/pi/Mycodo/install/requirements.txt (line 22)) (0.18.2)
[2021-12-03 20:05:47] Requirement already satisfied: ratelim in ./env/lib/python3.9/site-packages (from geocoder==1.38.1->-r /home/pi/Mycodo/install/requirements.txt (line 22)) (0.1.6)
[2021-12-03 20:05:47] Requirement already satisfied: msgpack in ./env/lib/python3.9/site-packages (from influxdb==5.3.1->-r /home/pi/Mycodo/install/requirements.txt (line 24)) (1.0.3)
[2021-12-03 20:05:48] Requirement already satisfied: serpent>=1.27 in ./env/lib/python3.9/site-packages (from pyro5==5.12->-r /home/pi/Mycodo/install/requirements.txt (line 26)) (1.40)
[2021-12-03 20:05:48] Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests==2.26.0->-r /home/pi/Mycodo/install/requirements.txt (line 29)) (2020.6.20)
[2021-12-03 20:05:48] Requirement already satisfied: charset-normalizer~=2.0.0 in ./env/lib/python3.9/site-packages (from requests==2.26.0->-r /home/pi/Mycodo/install/requirements.txt (line 29)) (2.0.8)
[2021-12-03 20:05:48] Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3/dist-packages (from requests==2.26.0->-r /home/pi/Mycodo/install/requirements.txt (line 29)) (1.26.5)
[2021-12-03 20:05:48] Requirement already satisfied: MarkupSafe in ./env/lib/python3.9/site-packages (from WTForms==2.3.3->-r /home/pi/Mycodo/install/requirements.txt (line 33)) (2.0.1)
[2021-12-03 20:05:48] Requirement already satisfied: pycparser in ./env/lib/python3.9/site-packages (from cffi>=1.1->bcrypt==3.2.0->-r /home/pi/Mycodo/install/requirements.txt (line 4)) (2.21)
[2021-12-03 20:05:49] Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in ./env/lib/python3.9/site-packages (from jsonschema->Flask_RESTX==0.5.1->-r /home/pi/Mycodo/install/requirements.txt (line 17)) (0.18.0)
[2021-12-03 20:05:49] Requirement already satisfied: attrs>=17.4.0 in ./env/lib/python3.9/site-packages (from jsonschema->Flask_RESTX==0.5.1->-r /home/pi/Mycodo/install/requirements.txt (line 17)) (21.2.0)
[2021-12-03 20:05:49] Requirement already satisfied: decorator in /usr/lib/python3/dist-packages (from ratelim->geocoder==1.38.1->-r /home/pi/Mycodo/install/requirements.txt (line 22)) (4.4.2)
[2021-12-03 20:05:50] Installing collected packages: setuptools, argparse
[2021-12-03 20:05:50]   Attempting uninstall: setuptools
[2021-12-03 20:05:50]     Found existing installation: setuptools 59.4.0
[2021-12-03 20:05:50]     Uninstalling setuptools-59.4.0:
[2021-12-03 20:05:50]       Successfully uninstalled setuptools-59.4.0
[2021-12-03 20:05:51] Successfully installed argparse-1.4.0 setuptools-58.2.0
[2021-12-03 20:05:54] Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
[2021-12-03 20:05:54] Requirement already satisfied: pylibftdi==0.19.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-rpi.txt (line 2)) (0.19.0)
[2021-12-03 20:05:56] Requirement already satisfied: RPi.GPIO in /usr/lib/python3/dist-packages (from -r /home/pi/Mycodo/install/requirements-rpi.txt (line 3)) (0.7.0)
[2021-12-03 20:05:56] Requirement already satisfied: smbus2==0.4.1 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-rpi.txt (line 4)) (0.4.1)
[2021-12-03 20:06:00] Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
[2021-12-03 20:06:00] Requirement already satisfied: testfixtures==6.18.3 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-testing.txt (line 2)) (6.18.3)
[2021-12-03 20:06:02] Requirement already satisfied: mock==4.0.3 in /usr/lib/python3/dist-packages (from -r /home/pi/Mycodo/install/requirements-testing.txt (line 3)) (4.0.3)
[2021-12-03 20:06:03] Requirement already satisfied: pytest==6.2.5 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-testing.txt (line 4)) (6.2.5)
[2021-12-03 20:06:04] Requirement already satisfied: factory_boy==3.2.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-testing.txt (line 5)) (3.2.0)
[2021-12-03 20:06:04] Requirement already satisfied: webtest==3.0.0 in ./env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-testing.txt (line 6)) (3.0.0)
[2021-12-03 20:06:05] Requirement already satisfied: py>=1.8.2 in ./env/lib/python3.9/site-packages (from pytest==6.2.5->-r /home/pi/Mycodo/install/requirements-testing.txt (line 4)) (1.11.0)
[2021-12-03 20:06:05] Requirement already satisfied: toml in /usr/lib/python3/dist-packages (from pytest==6.2.5->-r /home/pi/Mycodo/install/requirements-testing.txt (line 4)) (0.10.1)
[2021-12-03 20:06:05] Requirement already satisfied: packaging in ./env/lib/python3.9/site-packages (from pytest==6.2.5->-r /home/pi/Mycodo/install/requirements-testing.txt (line 4)) (21.3)
[2021-12-03 20:06:05] Requirement already satisfied: attrs>=19.2.0 in ./env/lib/python3.9/site-packages (from pytest==6.2.5->-r /home/pi/Mycodo/install/requirements-testing.txt (line 4)) (21.2.0)
[2021-12-03 20:06:05] Requirement already satisfied: iniconfig in ./env/lib/python3.9/site-packages (from pytest==6.2.5->-r /home/pi/Mycodo/install/requirements-testing.txt (line 4)) (1.1.1)
[2021-12-03 20:06:05] Requirement already satisfied: pluggy<2.0,>=0.12 in ./env/lib/python3.9/site-packages (from pytest==6.2.5->-r /home/pi/Mycodo/install/requirements-testing.txt (line 4)) (1.0.0)
[2021-12-03 20:06:05] Requirement already satisfied: Faker>=0.7.0 in ./env/lib/python3.9/site-packages (from factory_boy==3.2.0->-r /home/pi/Mycodo/install/requirements-testing.txt (line 5)) (9.9.0)
[2021-12-03 20:06:05] Requirement already satisfied: WebOb>=1.2 in ./env/lib/python3.9/site-packages (from webtest==3.0.0->-r /home/pi/Mycodo/install/requirements-testing.txt (line 6)) (1.8.7)
[2021-12-03 20:06:05] Requirement already satisfied: beautifulsoup4 in /usr/lib/python3/dist-packages (from webtest==3.0.0->-r /home/pi/Mycodo/install/requirements-testing.txt (line 6)) (4.9.3)
[2021-12-03 20:06:05] Requirement already satisfied: waitress>=0.8.5 in ./env/lib/python3.9/site-packages (from webtest==3.0.0->-r /home/pi/Mycodo/install/requirements-testing.txt (line 6)) (2.0.0)
[2021-12-03 20:06:05] Requirement already satisfied: python-dateutil>=2.4 in ./env/lib/python3.9/site-packages (from Faker>=0.7.0->factory_boy==3.2.0->-r /home/pi/Mycodo/install/requirements-testing.txt (line 5)) (2.8.2)
[2021-12-03 20:06:05] Requirement already satisfied: text-unidecode==1.3 in ./env/lib/python3.9/site-packages (from Faker>=0.7.0->factory_boy==3.2.0->-r /home/pi/Mycodo/install/requirements-testing.txt (line 5)) (1.3)
[2021-12-03 20:06:05] Requirement already satisfied: soupsieve>1.2 in /usr/lib/python3/dist-packages (from beautifulsoup4->webtest==3.0.0->-r /home/pi/Mycodo/install/requirements-testing.txt (line 6)) (2.2.1)
[2021-12-03 20:06:05] Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/lib/python3/dist-packages (from packaging->pytest==6.2.5->-r /home/pi/Mycodo/install/requirements-testing.txt (line 4)) (2.4.7)
[2021-12-03 20:06:05] Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.4->Faker>=0.7.0->factory_boy==3.2.0->-r /home/pi/Mycodo/install/requirements-testing.txt (line 5)) (1.16.0)
[2021-12-03 20:06:08] 
[2021-12-03 20:06:08] #### Ensuring compatible version of influxdb is installed ####
[2021-12-03 20:06:08] Correct version of InfluxDB currently installed
[2021-12-03 20:06:08] 
[2021-12-03 20:06:08] #### Upgrading Mycodo database with alembic (if needed)
[2021-12-03 20:06:09] INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
[2021-12-03 20:06:09] INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
[2021-12-03 20:06:10] 
[2021-12-03 20:06:10] #### Executing post-alembic script
[2021-12-03 20:06:12] Found revision IDs to execute code: []
[2021-12-03 20:06:12] Completed without errors. Deleting /home/pi/Mycodo/databases/alembic_post_upgrade_versions
[2021-12-03 20:06:12] 
[2021-12-03 20:06:12] #### Checking for updates to dependencies
[2021-12-03 20:06:19] 2021-12-03 20:06:19,932 Exception checking python dependency: luma.oled
[2021-12-03 20:06:45] Reading package lists...
[2021-12-03 20:06:45] Building dependency tree...
[2021-12-03 20:06:45] Reading state information...
[2021-12-03 20:06:45] libfreetype6-dev is already the newest version (2.10.4+dfsg-1).
[2021-12-03 20:06:45] libopenjp2-7 is already the newest version (2.4.0-3).
[2021-12-03 20:06:45] libopenjp2-7 set to manually installed.
[2021-12-03 20:06:45] libtiff5 is already the newest version (4.2.0-1).
[2021-12-03 20:06:45] libtiff5 set to manually installed.
[2021-12-03 20:06:45] python3-dev is already the newest version (3.9.2-3).
[2021-12-03 20:06:45] python3-numpy is already the newest version (1:1.19.5-1).
[2021-12-03 20:06:45] python3-psutil is already the newest version (5.8.0-1).
[2021-12-03 20:06:45] python3-psutil set to manually installed.
[2021-12-03 20:06:45] rsync is already the newest version (3.2.3-4+deb11u1).
[2021-12-03 20:06:45] unzip is already the newest version (6.0-26).
[2021-12-03 20:06:45] zlib1g-dev is already the newest version (1:1.2.11.dfsg-2).
[2021-12-03 20:06:45] zlib1g-dev set to manually installed.
[2021-12-03 20:06:45] bluez is already the newest version (5.55-3.1+rpt1).
[2021-12-03 20:06:45] bluez set to manually installed.
[2021-12-03 20:06:45] pi-bluetooth is already the newest version (0.1.18).
[2021-12-03 20:06:45] The following packages were automatically installed and are no longer required:
[2021-12-03 20:06:45]   libfuse2 python-is-python2
[2021-12-03 20:06:45] Use 'apt autoremove' to remove them.
[2021-12-03 20:06:45] 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[2021-12-03 20:06:45] 
[2021-12-03 20:06:45] Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
[2021-12-03 20:06:45] Requirement already satisfied: Pillow==8.1.2 in /usr/lib/python3/dist-packages (from -r /home/pi/Mycodo/install/requirements-generated.txt (line 1)) (8.1.2)
[2021-12-03 20:06:45] Requirement already satisfied: pyusb==1.1.1 in ./pi/Mycodo/env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-generated.txt (line 2)) (1.1.1)
[2021-12-03 20:06:45] Requirement already satisfied: adafruit-extended-bus==1.0.1 in ./pi/Mycodo/env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-generated.txt (line 3)) (1.0.1)
[2021-12-03 20:06:45] Requirement already satisfied: smbus2==0.4.1 in ./pi/Mycodo/env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-generated.txt (line 4)) (0.4.1)
[2021-12-03 20:06:45] Requirement already satisfied: pylibftdi==0.19.0 in ./pi/Mycodo/env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-generated.txt (line 5)) (0.19.0)
[2021-12-03 20:06:45] Requirement already satisfied: adafruit-circuitpython-seesaw==1.7.2 in ./pi/Mycodo/env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-generated.txt (line 7)) (1.7.2)
[2021-12-03 20:06:45] Collecting requests==2.25.1
[2021-12-03 20:06:45]   Downloading https://www.piwheels.org/simple/requests/requests-2.25.1-py2.py3-none-any.whl (61 kB)
[2021-12-03 20:06:45] Requirement already satisfied: sense-hat==2.2.0 in /usr/lib/python3/dist-packages (from -r /home/pi/Mycodo/install/requirements-generated.txt (line 9)) (2.2.0)
[2021-12-03 20:06:45] Requirement already satisfied: RPi.GPIO==0.7.0 in /usr/lib/python3/dist-packages (from -r /home/pi/Mycodo/install/requirements-generated.txt (line 10)) (0.7.0)
[2021-12-03 20:06:45] Requirement already satisfied: adafruit-circuitPython-scd30==2.0.3 in ./pi/Mycodo/env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-generated.txt (line 11)) (2.0.3)
[2021-12-03 20:06:45] Collecting Adafruit-PureIO==1.1.8
[2021-12-03 20:06:45]   Downloading https://www.piwheels.org/simple/adafruit-pureio/Adafruit_PureIO-1.1.8-py3-none-any.whl (12 kB)
[2021-12-03 20:06:45] Requirement already satisfied: python-kasa==0.4.0.dev4 in 

Here is the 2nd part of the contents of the /var/log/mycodo/mycodoupgrade.log:

./pi/Mycodo/env/lib/python3.9/site-packages (from -r /home/pi/Mycodo/install/requirements-generated.txt (line 15)) (0.4.0.dev4)
[2021-12-03 20:06:45] Collecting picamerab==1.13b1
[2021-12-03 20:06:45]   Downloading https://www.piwheels.org/simple/picamerab/picamerab-1.13b1-py3-none-any.whl (149 kB)
[2021-12-03 20:06:45] Requirement already satisfied: Adafruit-Blinka in ./pi/Mycodo/env/lib/python3.9/site-packages (from adafruit-extended-bus==1.0.1->-r /home/pi/Mycodo/install/requirements-generated.txt (line 3)) (6.15.0)
[2021-12-03 20:06:45] Requirement already satisfied: adafruit-circuitpython-busdevice in ./pi/Mycodo/env/lib/python3.9/site-packages (from adafruit-circuitpython-seesaw==1.7.2->-r /home/pi/Mycodo/install/requirements-generated.txt (line 7)) (5.1.1)
[2021-12-03 20:06:45] Requirement already satisfied: chardet<5,>=3.0.2 in /usr/lib/python3/dist-packages (from requests==2.25.1->-r /home/pi/Mycodo/install/requirements-generated.txt (line 8)) (4.0.0)
[2021-12-03 20:06:45] Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests==2.25.1->-r /home/pi/Mycodo/install/requirements-generated.txt (line 8)) (2020.6.20)
[2021-12-03 20:06:45] Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3/dist-packages (from requests==2.25.1->-r /home/pi/Mycodo/install/requirements-generated.txt (line 8)) (1.26.5)
[2021-12-03 20:06:45] Requirement already satisfied: idna<3,>=2.5 in /usr/lib/python3/dist-packages (from requests==2.25.1->-r /home/pi/Mycodo/install/requirements-generated.txt (line 8)) (2.10)
[2021-12-03 20:06:45] Requirement already satisfied: adafruit-circuitpython-register in ./pi/Mycodo/env/lib/python3.9/site-packages (from adafruit-circuitPython-scd30==2.0.3->-r /home/pi/Mycodo/install/requirements-generated.txt (line 11)) (1.9.6)
[2021-12-03 20:06:45] Requirement already satisfied: asyncclick<8,>=7 in ./pi/Mycodo/env/lib/python3.9/site-packages (from python-kasa==0.4.0.dev4->-r /home/pi/Mycodo/install/requirements-generated.txt (line 15)) (7.1.2.3)
[2021-12-03 20:06:45] Requirement already satisfied: importlib-metadata in ./pi/Mycodo/env/lib/python3.9/site-packages (from python-kasa==0.4.0.dev4->-r /home/pi/Mycodo/install/requirements-generated.txt (line 15)) (4.8.2)
[2021-12-03 20:06:45] Requirement already satisfied: colorzero in /usr/lib/python3/dist-packages (from picamerab==1.13b1->-r /home/pi/Mycodo/install/requirements-generated.txt (line 16)) (1.1)
[2021-12-03 20:06:45] Requirement already satisfied: anyio>=2 in ./pi/Mycodo/env/lib/python3.9/site-packages (from asyncclick<8,>=7->python-kasa==0.4.0.dev4->-r /home/pi/Mycodo/install/requirements-generated.txt (line 15)) (3.4.0)
[2021-12-03 20:06:45] Requirement already satisfied: Adafruit-PlatformDetect>=3.13.0 in ./pi/Mycodo/env/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-extended-bus==1.0.1->-r /home/pi/Mycodo/install/requirements-generated.txt (line 3)) (3.17.2)
[2021-12-03 20:06:45] Requirement already satisfied: pyftdi>=0.40.0 in ./pi/Mycodo/env/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-extended-bus==1.0.1->-r /home/pi/Mycodo/install/requirements-generated.txt (line 3)) (0.53.3)
[2021-12-03 20:06:45] Requirement already satisfied: rpi-ws281x>=4.0.0 in ./pi/Mycodo/env/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-extended-bus==1.0.1->-r /home/pi/Mycodo/install/requirements-generated.txt (line 3)) (4.3.1)
[2021-12-03 20:06:45] Requirement already satisfied: sysv-ipc>=1.1.0 in ./pi/Mycodo/env/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-extended-bus==1.0.1->-r /home/pi/Mycodo/install/requirements-generated.txt (line 3)) (1.1.0)
[2021-12-03 20:06:45] Requirement already satisfied: zipp>=0.5 in ./pi/Mycodo/env/lib/python3.9/site-packages (from importlib-metadata->python-kasa==0.4.0.dev4->-r /home/pi/Mycodo/install/requirements-generated.txt (line 15)) (3.6.0)
[2021-12-03 20:06:45] Requirement already satisfied: sniffio>=1.1 in ./pi/Mycodo/env/lib/python3.9/site-packages (from anyio>=2->asyncclick<8,>=7->python-kasa==0.4.0.dev4->-r /home/pi/Mycodo/install/requirements-generated.txt (line 15)) (1.2.0)
[2021-12-03 20:06:45] Requirement already satisfied: pyserial>=3.0 in ./pi/Mycodo/env/lib/python3.9/site-packages (from pyftdi>=0.40.0->Adafruit-Blinka->adafruit-extended-bus==1.0.1->-r /home/pi/Mycodo/install/requirements-generated.txt (line 3)) (3.5)
[2021-12-03 20:06:45] Installing collected packages: Adafruit-PureIO, requests, picamerab
[2021-12-03 20:06:45]   Attempting uninstall: Adafruit-PureIO
[2021-12-03 20:06:45]     Found existing installation: Adafruit-PureIO 1.1.9
[2021-12-03 20:06:45]     Uninstalling Adafruit-PureIO-1.1.9:
[2021-12-03 20:06:45]       Successfully uninstalled Adafruit-PureIO-1.1.9
[2021-12-03 20:06:45]   Attempting uninstall: requests
[2021-12-03 20:06:45]     Found existing installation: requests 2.26.0
[2021-12-03 20:06:45]     Uninstalling requests-2.26.0:
[2021-12-03 20:06:45]       Successfully uninstalled requests-2.26.0
[2021-12-03 20:06:45] Successfully installed Adafruit-PureIO-1.1.8 picamerab-1.13b1 requests-2.25.1
[2021-12-03 20:06:45] 
[2021-12-03 20:06:45] 
[2021-12-03 20:06:45] #### Disabling installed mycodo startup script
[2021-12-03 20:06:45] Removed /etc/systemd/system/multi-user.target.wants/mycodo.service.
[2021-12-03 20:06:45] Removed /etc/systemd/system/mycodo.service.
[2021-12-03 20:06:46] #### Enabling current mycodo startup script
[2021-12-03 20:06:46] Created symlink /etc/systemd/system/mycodo.service → /home/pi/Mycodo/install/mycodo.service.
[2021-12-03 20:06:46] Created symlink /etc/systemd/system/multi-user.target.wants/mycodo.service → /home/pi/Mycodo/install/mycodo.service.
[2021-12-03 20:06:47] 
[2021-12-03 20:06:47] #### Compiling Translations
[2021-12-03 20:06:48] compiling catalog mycodo_flask/translations/nl/LC_MESSAGES/messages.po to mycodo_flask/translations/nl/LC_MESSAGES/messages.mo
[2021-12-03 20:06:48] compiling catalog mycodo_flask/translations/de/LC_MESSAGES/messages.po to mycodo_flask/translations/de/LC_MESSAGES/messages.mo
[2021-12-03 20:06:48] compiling catalog mycodo_flask/translations/es/LC_MESSAGES/messages.po to mycodo_flask/translations/es/LC_MESSAGES/messages.mo
[2021-12-03 20:06:48] compiling catalog mycodo_flask/translations/pt/LC_MESSAGES/messages.po to mycodo_flask/translations/pt/LC_MESSAGES/messages.mo
[2021-12-03 20:06:48] compiling catalog mycodo_flask/translations/nb/LC_MESSAGES/messages.po to mycodo_flask/translations/nb/LC_MESSAGES/messages.mo
[2021-12-03 20:06:49] compiling catalog mycodo_flask/translations/sv/LC_MESSAGES/messages.po to mycodo_flask/translations/sv/LC_MESSAGES/messages.mo
[2021-12-03 20:06:49] compiling catalog mycodo_flask/translations/sr/LC_MESSAGES/messages.po to mycodo_flask/translations/sr/LC_MESSAGES/messages.mo
[2021-12-03 20:06:49] compiling catalog mycodo_flask/translations/ru/LC_MESSAGES/messages.po to mycodo_flask/translations/ru/LC_MESSAGES/messages.mo
[2021-12-03 20:06:49] compiling catalog mycodo_flask/translations/zh/LC_MESSAGES/messages.po to mycodo_flask/translations/zh/LC_MESSAGES/messages.mo
[2021-12-03 20:06:49] compiling catalog mycodo_flask/translations/fr/LC_MESSAGES/messages.po to mycodo_flask/translations/fr/LC_MESSAGES/messages.mo
[2021-12-03 20:06:50] compiling catalog mycodo_flask/translations/it/LC_MESSAGES/messages.po to mycodo_flask/translations/it/LC_MESSAGES/messages.mo
[2021-12-03 20:06:50] compiling catalog mycodo_flask/translations/pl/LC_MESSAGES/messages.po to mycodo_flask/translations/pl/LC_MESSAGES/messages.mo
[2021-12-03 20:06:50] 
[2021-12-03 20:06:50] #### Generating widget HTML files
[2021-12-03 20:06:53] 
[2021-12-03 20:06:53] #### Remove Mycodo restart monitor crontab entry (if it exists)
[2021-12-03 20:06:53] Crontab entry does not exist, nothing to do.
[2021-12-03 20:06:53] 
[2021-12-03 20:06:53] #### Setting permissions
[2021-12-03 20:06:54] 
[2021-12-03 20:06:54] #### Restarting the Mycodo daemon
[2021-12-03 20:06:56] 
[2021-12-03 20:06:56] #### Restarting nginx
[2021-12-03 20:07:03] #### Reloading mycodoflask
[2021-12-03 20:07:03] 
[2021-12-03 20:07:03] #### Connecting to http://localhost (creates Mycodo database if it doesn't exist)
[2021-12-03 20:07:07] #### Successfully connected to http://localhost
[2021-12-03 20:07:07] 
[2021-12-03 20:07:07] Stage 3 execution time summary:
[2021-12-03 20:07:07] initialize:                   5 s
[2021-12-03 20:07:07] update-swap-size:             0 s
[2021-12-03 20:07:07] setup-virtualenv:             0 s
[2021-12-03 20:07:07] update-apt:                   6 s
[2021-12-03 20:07:07] update-packages:              9 s
[2021-12-03 20:07:07] web-server-update:            3 s
[2021-12-03 20:07:07] update-logrotate:             0 s
[2021-12-03 20:07:07] update-pip3:                  7 s
[2021-12-03 20:07:07] update-pip3-packages:         59 s
[2021-12-03 20:07:07] update-dependencies:          33 s
[2021-12-03 20:07:07] update-influxdb:              1 s
[2021-12-03 20:07:07] update-alembic:               2 s
[2021-12-03 20:07:07] update-alembic-post:          2 s
[2021-12-03 20:07:07] update-mycodo-startup-script: 2 s
[2021-12-03 20:07:07] compile-translations:         3 s
[2021-12-03 20:07:07] generate-widget-html:         2 s
[2021-12-03 20:07:07] update-cron:                  1 s
[2021-12-03 20:07:07] update-permissions:           1 s
[2021-12-03 20:07:07] restart-daemon:               2 s
[2021-12-03 20:07:07] web-server_reload:            7 s
[2021-12-03 20:07:07] web-server-connect:           4 s
[2021-12-03 20:07:07] 
[2021-12-03 20:07:07] #### Completed Upgrade Stage 3 of 3 in 149 seconds ####
[2021-12-03 20:07:07] 
[2021-12-03 20:07:07] Upgrade completed. Review the log to ensure no critical errors were encountered

I misread your initial post. I thiought you wrote you upgraded the version of Mycodo, but you were referring to Python. You likely broke the virtualenvironment by removing the version of python it was using.