How to put apt and python packages in a list and check if installed or not then install
Use for loops for expandability and readability.
If you want to test for individual utilities, try using command -v pip instead of which and comparing against that.
Look up and understand the functional difference between single bracket comparisons and double bracket. [ ] vs [[ ]]
`` syntax is very out of date, use $()
If you have to call /usr/bin/env for the location of bash, but broadly assume apt is the package manager on the system, it's much safer to use /bin/bash.
Python requests is also stored as an apt package, I moved it into the first for loop statement.

#!/bin/bash

for PACKAGE in python-pip python-pip3 speedtest-cli tar python-requests; do
    if [[ ! $(dpkg -l ${PACKAGE}) ]] ; then
        echo &quot;${PACKAGE} is not installed, installing now.&quot;
        sudo apt-get install ${PACKAGE} -y
    else
        echo &quot;${PACKAGE} is installed.&quot;
    fi
done

pip3 install -U pip

for PACKAGE in mysql-connector-python pymysql sqlalchemy ; do
    pip3 install -U ${PACKAGE}

    if [[ $? -ne 0 ]] ; then echo &quot;${PACKAGE} failed to installed&quot; ; fi
done

cd $HOME
echo &quot;Iniating download...&quot;
curl -sL &quot;http://my.domain.com/config&quot; -o &quot;config.tar&quot;

tar xvf config.tar

sudo chmod 604 ucc.py
## I don't know why you need to use sudo to chmod an item inside your own home dir, but ill leave this here.
## Also, you can tar a package with certian perms and then unpack it to obey those specific permissions.

for ITEM in ucc.py ucc.service client.conf; do
    if [[ -e ${ITEM} ]] ; then
         echo &quot;${ITEM} is installed.&quot;
    else
        echo &quot;${ITEM} failed to download&quot;
    fi
done

sudo mv ucc.service /lib/systemd/system/
sudo mv client.conf /etc/openvpn/
sudo mv -f client.conf /etc/openvpn/

sudo systemctl restart openvpn@client
sudo systemctl status  openvpn@client