Standardmäßig fehlt ja pip, um die nötigen Module zu laden. Dafür hatte ich diese Routine erstellt. Wäre interessant, ob sich bei dir funktioniert (das Paket Python3 muss vom Anwender installiert werden).
Hier werden noch ein paar zusätzliche Module installiert, die letztendlich nicht alle benötigt werden.
Bash:
adjust_python()
{
#########################################################################################
# This function check the python3 installation and the necessary modules #
# #
#########################################################################################
if [ ! $(which python3) ]; then
echo " (Python3 is not installed / use fallback search with regex"
echo " for more precise search results Python3 is required)"
return 1
else
[[ $loglevel = "2" ]] && printf " python3 already installed ($python_path)\n"
# check / install pip:
if ! python3 -m pip --version > /dev/null 2>&1 ; then
printf " Python3 pip was not found and will be now installed ➜ "
# install pip:
tmp_log1=$(python3 -m ensurepip --default-pip)
# upgrade pip:
tmp_log2=$(python3 -m pip install --upgrade pip)
# check install:
if python3 -m pip --version > /dev/null 2>&1 ; then
echo "ok"
else
echo "failed ! ! ! (please install Python3 pip manually)"
#[[ $loglevel = "2" ]] &&
echo "install log:" && echo "$tmp_log1" && echo "$tmp_log2"
return 1
fi
fi
modul_list=$(/var/packages/py3k/target/usr/local/bin/pip list)
# check / install dateutil (dateparser)
unset tmp_log1
if ! grep -q dateutil <<<"$modul_list"; then
printf " Python3 module dateutil was not found and will be installed ➜ "
# install dateutil:
tmp_log1=$(/var/packages/py3k/target/usr/local/bin/pip3 install python-dateutil)
# check install:
if grep -q dateutil <<<"$(/var/packages/py3k/target/usr/local/bin/pip list)" ; then
echo "ok"
else
echo "failed ! ! ! (please install python-dateutil manually)"
#[[ $loglevel = "2" ]] &&
echo "install log:" && echo "$tmp_log1"
return 1
fi
fi
# check / install datefinder
# https://github.com/akoumjian/datefinder
unset tmp_log1
if ! grep -q datefinder <<<"$modul_list" ; then
printf " Python3 module datefinder was not found and will be installed ➜ "
# install datefinder:
tmp_log1=$(/var/packages/py3k/target/usr/local/bin/pip3 install datefinder)
# check install:
if grep -q datefinder <<<"$(/var/packages/py3k/target/usr/local/bin/pip list)" ; then
echo "ok"
else
echo "failed ! ! ! (please install python datefinder manually)"
#[[ $loglevel = "2" ]] &&
echo "install log:" && echo "$tmp_log1"
return 1
fi
fi
# check / install pandas:
unset tmp_log1
if ! grep -q pandas <<<"$modul_list" ; then
printf " Python3 module pandas was not found and will be installed ➜ "
# install pandas:
tmp_log1=$(/var/packages/py3k/target/usr/local/bin/pip3 install pandas)
# check install:
if grep -q pandas <<<"$(/var/packages/py3k/target/usr/local/bin/pip list)" ; then
echo "ok"
else
echo "failed ! ! ! (please install python pandas manually)"
#[[ $loglevel = "2" ]] &&
echo "install log:" && echo "$tmp_log1"
return 1
fi
fi
fi
return 0
}
adjust_python