Upgrade error, need help

root@vmi927521:/# ./cyberpanel_upgrade.sh

Fetching latest data from CyberPanel server...

This may take few seconds...
mysql: unknown variable 'slow-query-log=1'

Checking root privileges...

You are running as root...

Checking server location...

System: Ubuntu 20 detected...


Press the Enter key to continue with latest version, or enter specific version such as: 1.9.4 , 1.9.5 ...etc

If nothing is input in 10 seconds, script will proceed with the latest stable version.

Please press the Enter key or specify a version number, or wait for 10 seconds:
Branch name set to v2.3.9
Ign:1 http://rpms.litespeedtech.com/debian focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://rpms.litespeedtech.com/debian focal Release
Hit:4 https://repo.imunify360.cloudlinux.com/imunify360/ubuntu/20.04 focal InRelease
Hit:5 https://download.imunify360.com/ubuntu/20.04/slot-1 focal InRelease
Hit:7 http://asi-fs-s.contabo.net/ubuntu focal InRelease
Hit:8 http://asi-fs-s.contabo.net/ubuntu focal-updates InRelease
Hit:9 http://asi-fs-s.contabo.net/ubuntu focal-backports InRelease
Hit:10 https://download.imunify360.com/ubuntu/20.04/slot-2 focal InRelease
Hit:11 https://download.imunify360.com/ubuntu/20.04/slot-3 focal InRelease
Hit:12 https://download.imunify360.com/ubuntu/20.04/slot-4 focal InRelease
Hit:13 https://download.imunify360.com/ubuntu/20.04/slot-5 focal InRelease
Hit:14 https://download.imunify360.com/ubuntu/20.04/slot-6 focal InRelease
Hit:15 https://download.imunify360.com/ubuntu/20.04/slot-7 focal InRelease
Hit:16 https://download.imunify360.com/ubuntu/20.04/slot-8 focal InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-105 linux-headers-5.4.0-105-generic linux-image-5.4.0-105-generic linux-modules-5.4.0-105-generic linux-modules-extra-5.4.0-105-generic
  python3-appdirs python3-distlib python3-filelock python3-importlib-metadata python3-more-itertools python3-virtualenv python3-zipp
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
htop is already the newest version (2.2.0-2build1).
libattr1 is already the newest version (1:2.4.48-5).
libattr1-dev is already the newest version (1:2.4.48-5).
libidn2-0-dev is already the newest version (2.2.0-2).
libidn2-dev is already the newest version (2.2.0-2).
libpsl-dev is already the newest version (0.21.0-1ubuntu1).
librtmp-dev is already the newest version (2.4+20151223.gitfa8646d.1-2build1).
telnet is already the newest version (0.17-41.2build1).
idn2 is already the newest version (2.2.0-2).
git is already the newest version (1:2.25.1-1ubuntu3.13).
libcomerr2 is already the newest version (1.45.5-2ubuntu1.2).
libcurl4-gnutls-dev is already the newest version (7.68.0-1ubuntu2.25).
libgcrypt20-dev is already the newest version (1.8.5-5ubuntu1.1).
libgnutls28-dev is already the newest version (3.6.13-2ubuntu1.11).
libgpgme-dev is already the newest version (1.13.1-7ubuntu2.2).
libgssapi-krb5-2 is already the newest version (1.17-6ubuntu4.7).
libk5crypto3 is already the newest version (1.17-6ubuntu4.7).
libkrb5-dev is already the newest version (1.17-6ubuntu4.7).
libldap2-dev is already the newest version (2.4.49+dfsg-2ubuntu1.10).
liblzma-dev is already the newest version (5.2.4-1ubuntu1.1).
libnghttp2-dev is already the newest version (1.40.0-1ubuntu0.3).
libssl-dev is already the newest version (1.1.1f-1ubuntu2.23).
nettle-dev is already the newest version (3.5.1+really3.5.1-2ubuntu0.2).
dnsutils is already the newest version (1:9.18.28-0ubuntu0.20.04.1).
libmariadbclient-dev is already the newest version (1:10.3.39-0ubuntu0.20.04.2).
nghttp2 is already the newest version (1.40.0-1ubuntu0.3).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-105 linux-headers-5.4.0-105-generic linux-image-5.4.0-105-generic linux-modules-5.4.0-105-generic linux-modules-extra-5.4.0-105-generic
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
  virtualenv
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,144 B of archives.
After this operation, 23.6 kB of additional disk space will be used.
Get:1 http://asi-fs-s.contabo.net/ubuntu focal-updates/universe amd64 virtualenv all 20.0.17-1ubuntu0.4 [2,144 B]
Fetched 2,144 B in 0s (92.6 kB/s)
debconf: unable to initialize frontend: Noninteracitve
debconf: (Can't locate Debconf/FrontEnd/Noninteracitve.pm in @INC (you may need to install the Debconf::FrontEnd::Noninteracitve module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at (eval 19) line 2, <> line 1.)
debconf: falling back to frontend: Noninteractive
Selecting previously unselected package virtualenv.
(Reading database ... 177312 files and directories currently installed.)
Preparing to unpack .../virtualenv_20.0.17-1ubuntu0.4_all.deb ...
Unpacking virtualenv (20.0.17-1ubuntu0.4) ...
Setting up virtualenv (20.0.17-1ubuntu0.4) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (20.0.2-5ubuntu1.11).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-105 linux-headers-5.4.0-105-generic linux-image-5.4.0-105-generic linux-modules-5.4.0-105-generic linux-modules-extra-5.4.0-105-generic
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libffi-dev is already the newest version (3.3-4).
python3-dev is already the newest version (3.8.2-0ubuntu2).
build-essential is already the newest version (12.8ubuntu1.1).
libssl-dev is already the newest version (1.1.1f-1ubuntu2.23).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-105 linux-headers-5.4.0-105-generic linux-image-5.4.0-105-generic linux-modules-5.4.0-105-generic linux-modules-extra-5.4.0-105-generic
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-venv is already the newest version (3.8.2-0ubuntu2).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-105 linux-headers-5.4.0-105-generic linux-image-5.4.0-105-generic linux-modules-5.4.0-105-generic linux-modules-extra-5.4.0-105-generic
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-105 linux-headers-5.4.0-105-generic linux-image-5.4.0-105-generic linux-modules-5.4.0-105-generic linux-modules-extra-5.4.0-105-generic
  python3-appdirs python3-distlib python3-filelock python3-importlib-metadata python3-more-itertools python3-virtualenv python3-zipp
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  virtualenv*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 23.6 kB disk space will be freed.
(Reading database ... 177314 files and directories currently installed.)
Removing virtualenv (20.0.17-1ubuntu0.4) ...
/usr/bin/pip:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import load_entry_point
Found existing installation: virtualenv 20.28.0
Uninstalling virtualenv-20.28.0:
  Successfully uninstalled virtualenv-20.28.0
/usr/bin/pip3:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import load_entry_point
Collecting virtualenv
  Using cached virtualenv-20.28.0-py3-none-any.whl (4.3 MB)
Requirement already satisfied, skipping upgrade: distlib<1,>=0.3.7 in /usr/local/lib/python3.8/dist-packages (from virtualenv) (0.3.9)
Requirement already satisfied, skipping upgrade: filelock<4,>=3.12.2 in /usr/local/lib/python3.8/dist-packages (from virtualenv) (3.16.1)
Requirement already satisfied, skipping upgrade: platformdirs<5,>=3.9.1 in /usr/local/lib/python3.8/dist-packages (from virtualenv) (4.3.6)
Installing collected packages: virtualenv
Successfully installed virtualenv-20.28.0
Hit:1 https://repo.imunify360.cloudlinux.com/imunify360/ubuntu/20.04 focal InRelease
Hit:2 http://asi-fs-s.contabo.net/ubuntu focal InRelease
Hit:3 http://asi-fs-s.contabo.net/ubuntu focal-updates InRelease
Hit:4 http://asi-fs-s.contabo.net/ubuntu focal-backports InRelease
Ign:5 http://rpms.litespeedtech.com/debian focal InRelease
Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:7 http://rpms.litespeedtech.com/debian focal Release
Hit:8 https://download.imunify360.com/ubuntu/20.04/slot-1 focal InRelease
Hit:9 https://download.imunify360.com/ubuntu/20.04/slot-2 focal InRelease
Hit:10 https://download.imunify360.com/ubuntu/20.04/slot-3 focal InRelease
Hit:11 https://download.imunify360.com/ubuntu/20.04/slot-4 focal InRelease
Hit:13 https://download.imunify360.com/ubuntu/20.04/slot-5 focal InRelease
Hit:14 https://download.imunify360.com/ubuntu/20.04/slot-6 focal InRelease
Hit:15 https://download.imunify360.com/ubuntu/20.04/slot-7 focal InRelease
Hit:16 https://download.imunify360.com/ubuntu/20.04/slot-8 focal InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-105 linux-headers-5.4.0-105-generic linux-image-5.4.0-105-generic linux-modules-5.4.0-105-generic linux-modules-extra-5.4.0-105-generic
  python3-appdirs python3-distlib python3-filelock python3-importlib-metadata python3-more-itertools python3-virtualenv python3-zipp
Use 'apt autoremove' to remove them.
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
  libmagickcore-6.q16-6-extra libopenexr-dev libmagickwand-6.q16-6 python3-pip
  libmagickwand-6-headers redis libmagickcore-6-headers redis-tools
  libmagickcore-6-arch-config libmagickwand-6.q16-dev libopenexr24
  libmagickcore-6.q16-6 libmagickwand-dev redis-server libmagickcore-6.q16-dev
  python-pip-whl imagemagick-6-common
Learn more about Ubuntu Pro at https://ubuntu.com/pro
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/usr/bin/pip3:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import load_entry_point
Requirement already up-to-date: virtualenv in /usr/local/lib/python3.8/dist-packages (20.28.0)
Requirement already satisfied, skipping upgrade: distlib<1,>=0.3.7 in /usr/local/lib/python3.8/dist-packages (from virtualenv) (0.3.9)
Requirement already satisfied, skipping upgrade: filelock<4,>=3.12.2 in /usr/local/lib/python3.8/dist-packages (from virtualenv) (3.16.1)
Requirement already satisfied, skipping upgrade: platformdirs<5,>=3.9.1 in /usr/local/lib/python3.8/dist-packages (from virtualenv) (4.3.6)

Nothing found, need fresh setup...

created virtual environment CPython3.8.10.final.0-64 in 476ms
  creator CPython3Posix(dest=/usr/local/CyberPanel, clear=False, no_vcs_ignore=False, global=True)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
    added seed packages: pip==24.3.1, setuptools==75.3.0, wheel==0.45.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
Requirement already satisfied: setuptools in /usr/local/CyberPanel/lib/python3.8/site-packages (75.3.0)
Collecting packaging
  Using cached packaging-24.2-py3-none-any.whl.metadata (3.2 kB)
Using cached packaging-24.2-py3-none-any.whl (65 kB)
Installing collected packages: packaging
Successfully installed packaging-24.2
--2024-12-17 17:23:39--  https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.3.9/requirments-old.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.109.133, 185.199.111.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 584 [text/plain]
Saving to: ‘/usr/local/requirments.txt’

/usr/local/requirments.txt                100%[=====================================================================================>]     584  --.-KB/s    in 0s

2024-12-17 17:23:40 (21.4 MB/s) - ‘/usr/local/requirments.txt’ saved [584/584]

Collecting cffi==1.14.3 (from -r /usr/local/requirments.txt (line 1))
  Using cached cffi-1.14.3-cp38-cp38-manylinux1_x86_64.whl.metadata (1.2 kB)
Collecting bcrypt==3.2.0 (from -r /usr/local/requirments.txt (line 2))
  Using cached bcrypt-3.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.metadata (7.5 kB)
Collecting beautifulsoup4==4.9.3 (from -r /usr/local/requirments.txt (line 3))
  Using cached beautifulsoup4-4.9.3-py3-none-any.whl.metadata (4.2 kB)
Collecting boto3==1.18.26 (from -r /usr/local/requirments.txt (line 4))
  Using cached boto3-1.18.26-py3-none-any.whl.metadata (6.3 kB)
Collecting botocore==1.21.26 (from -r /usr/local/requirments.txt (line 5))
  Using cached botocore-1.21.26-py3-none-any.whl.metadata (5.5 kB)
Collecting cloudflare==2.8.13 (from -r /usr/local/requirments.txt (line 6))
  Using cached cloudflare-2.8.13-py3-none-any.whl
Collecting cryptography==3.2.1 (from -r /usr/local/requirments.txt (line 7))
  Using cached cryptography-3.2.1-cp35-abi3-manylinux2010_x86_64.whl.metadata (5.2 kB)
Collecting Django==3.1.3 (from -r /usr/local/requirments.txt (line 8))
  Using cached Django-3.1.3-py3-none-any.whl.metadata (3.7 kB)
Collecting docker==4.3.1 (from -r /usr/local/requirments.txt (line 9))
  Using cached docker-4.3.1-py2.py3-none-any.whl.metadata (3.7 kB)
Collecting google-api-core==1.23.0 (from -r /usr/local/requirments.txt (line 10))
  Using cached google_api_core-1.23.0-py2.py3-none-any.whl.metadata (2.3 kB)
Collecting google-api-python-client==1.12.5 (from -r /usr/local/requirments.txt (line 11))
  Using cached google_api_python_client-1.12.5-py2.py3-none-any.whl.metadata (3.9 kB)
Collecting google-auth==1.23.0 (from -r /usr/local/requirments.txt (line 12))
  Using cached google_auth-1.23.0-py2.py3-none-any.whl.metadata (3.3 kB)
Collecting google-auth-httplib2==0.0.4 (from -r /usr/local/requirments.txt (line 13))
  Using cached google_auth_httplib2-0.0.4-py2.py3-none-any.whl.metadata (2.1 kB)
Collecting google-auth-oauthlib==0.4.2 (from -r /usr/local/requirments.txt (line 14))
  Using cached google_auth_oauthlib-0.4.2-py2.py3-none-any.whl.metadata (2.4 kB)
Collecting googleapis-common-protos==1.52.0 (from -r /usr/local/requirments.txt (line 15))
  Using cached googleapis_common_protos-1.52.0-py2.py3-none-any.whl.metadata (1.3 kB)
Collecting ipaddress==1.0.23 (from -r /usr/local/requirments.txt (line 16))
  Using cached ipaddress-1.0.23-py2.py3-none-any.whl.metadata (923 bytes)
Collecting mysqlclient==2.0.1 (from -r /usr/local/requirments.txt (line 17))
  Using cached mysqlclient-2.0.1-cp38-cp38-linux_x86_64.whl
Collecting oauthlib==3.1.0 (from -r /usr/local/requirments.txt (line 18))
  Using cached oauthlib-3.1.0-py2.py3-none-any.whl.metadata (7.1 kB)
Collecting paramiko==2.9.2 (from -r /usr/local/requirments.txt (line 19))
  Using cached paramiko-2.9.2-py2.py3-none-any.whl.metadata (4.5 kB)
Collecting pexpect==4.8.0 (from -r /usr/local/requirments.txt (line 20))
  Using cached pexpect-4.8.0-py2.py3-none-any.whl.metadata (2.2 kB)
Collecting psutil==5.7.3 (from -r /usr/local/requirments.txt (line 21))
  Using cached psutil-5.7.3-cp38-cp38-linux_x86_64.whl
Collecting py3dns==4.0.2 (from -r /usr/local/requirments.txt (line 22))
  Using cached py3dns-4.0.2-py3-none-any.whl.metadata (7.1 kB)
Collecting pyOpenSSL==19.1.0 (from -r /usr/local/requirments.txt (line 23))
  Using cached pyOpenSSL-19.1.0-py2.py3-none-any.whl.metadata (4.7 kB)
Collecting pysftp (from -r /usr/local/requirments.txt (line 24))
  Using cached pysftp-0.2.9.tar.gz (25 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 14, in <module>
        File "/usr/local/CyberPanel/lib/python3.8/site-packages/setuptools/__init__.py", line 27, in <module>
          from .dist import Distribution
        File "<frozen importlib._bootstrap>", line 991, in _find_and_load
        File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
        File "/usr/local/CyberPanel/lib/python3.8/site-packages/_virtualenv.py", line 91, in exec_module
          old(module)
        File "/usr/local/CyberPanel/lib/python3.8/site-packages/setuptools/dist.py", line 30, in <module>
          from . import (
        File "/usr/local/CyberPanel/lib/python3.8/site-packages/setuptools/_entry_points.py", line 45, in <module>
          def validate(eps: metadata.EntryPoints):
      AttributeError: module 'importlib_metadata' has no attribute 'EntryPoints'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
above command failed...
root@vmi927521:/#

I have try tutorial from other post sudo pip install packaging==22 still not working and got more error.