From 03a8ba836681aaec7ec68ca3ea82f6639268818f Mon Sep 17 00:00:00 2001 From: Nicolas Date: Fri, 24 Jun 2022 12:53:41 +0200 Subject: [PATCH] apps_conda tested, tensowflow in userspace added "setup_tensorflow_conda.sh" --- setup_apps_conda.sh | 17 ++++++++--------- setup_tensorflow_conda.sh | 12 ++++++++++++ 2 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 setup_tensorflow_conda.sh diff --git a/setup_apps_conda.sh b/setup_apps_conda.sh index 219a320..9146b72 100644 --- a/setup_apps_conda.sh +++ b/setup_apps_conda.sh @@ -1,6 +1,6 @@ #!/bin/bash -#variant to use conda insted of pip, not tested +#variant to use conda insted of pip, tested #Src: https://medium.com/swlh/how-to-install-jupyterhub-using-conda-without-runing-as-root-and-make-it-a-service-59b843fead12 # https://jupyterhub.readthedocs.io/en/1.2.1/installation-guide-hard.html @@ -86,14 +86,16 @@ ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh mkdir -p /opt/conda/envs/ -/opt/conda/bin/conda create --prefix /opt/conda/envs/python python=3.7 ipykernel -/opt/conda/envs/python/bin/python -m ipykernel install --prefix /usr/local/ --name 'python' --display-name "Python (default)" +/opt/conda/bin/conda create --prefix /opt/conda/envs/default_python python=3.7 ipykernel --yes +/opt/conda/envs/python/bin/python -m ipykernel install --prefix /usr/local/ --name 'default_python' --display-name "Python (default)" #/opt/conda/envs/python/bin/python -m ipykernel install --prefix=/opt/jupyterhub/ --name 'python' --display-name "Python (default)" #install ofen used python packages for default environment -/opt/conda/bin/conda install h5py tqdm pandas pillow matplotlib ipympl opencv-python --yes --name python -/opt/conda/bin/conda install cantera --channel cantera --yes --name python +/opt/conda/bin/conda install h5py tqdm pandas pillow matplotlib ipympl matplotlib --yes -n default_python +/opt/conda/bin/conda install cantera --channel cantera --yes -n default_python +#remove ipykernel for base enviroment: +#jupyter kernelspec remove python3 #users have to setup there kernel like this: @@ -106,10 +108,7 @@ mkdir -p /opt/conda/envs/ #jupyter labextension install jupyter-matplotlib #echo "Install Tensorflow..." -#conda install --yes tensorflow-gpu - -#echo "Install cantera..." -#conda install --yes --channel cantera cantera +#conda install --yes tensorflow-gpu -c conda-forge #echo "Install common Python libs..." #conda install --yes h5py tqdm pandas ipywidgets pillow matplotlib ipympl opencv-python diff --git a/setup_tensorflow_conda.sh b/setup_tensorflow_conda.sh new file mode 100644 index 0000000..146b412 --- /dev/null +++ b/setup_tensorflow_conda.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +if [ "$EUID" -eq 0 ] + then echo "Please run not as root" + exit +fi + +conda create ipykernel --name tensorflow -c conda-forge +conda install --yes --name tensorflow tensorflow-gpu tensorboard -c conda-forge +python -m ipykernel install --user --name tensorflow --display-name "Python (Tensorflow)" \ No newline at end of file