Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • ckaufmann/install-python-tensorflow-gym
1 result
Select Git revision
Show changes
Commits on Source (6)
Showing
with 51 additions and 30 deletions
No preview for this file type
\RequirePackage{luatex85}
\documentclass[12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{xcolor}
......@@ -58,7 +57,7 @@
\usepackage[color=blue, author={Christof Kaufmann}]{attachfile2} % load after hyperref to avoid option clash from unicode=true
\title{Installationsanleitung für Python mit OpenAI Gym für Linux}
\date{April 2023}
\date{Mai 2023}
\author{Christof Kaufmann}
% one infinite page, https://tex.stackexchange.com/a/19241/115883
......@@ -183,6 +182,7 @@ Wir haben Spyder bereits in der Conda-Umgebung \lstinline|ml| installiert. Als n
mamba activate ml #*\color{cyan}\# \itshape sicherstellen, dass Sie in der 'ml' Umgebung sind*
spyder &
\end{lstlisting}
Alternativ können Sie auch die Desktop-Datei (\textattachfile{attachments/Spyder-ml.desktop}{Anhang}|\href{https://gitlab.cvh-server.de/ckaufmann/install-python-tensorflow-gym/-/raw/master/attachments/Spyder-ml.desktop?inline=false}{Web}) zum Starten per Doppelklick verwenden. Passen Sie darin noch den Pfad zum Icon an (Beispielbenutzername ist \texttt{john}) und machen Sie die Datei ausführbar. Kopieren Sie dann die Datei in Ihr Desktopverzeichnis (oft \lstinline|~/Schreibtisch/|). Wenn Sie Spyder zusätzlich zum Desktop auch im Startmenü sehen wollen, kopieren Sie die Datei noch nach \lstinline|~/.local/share/applications/|.
Spyder öffnet sich nun. Wenn Sie die Plots lieber in eigenständigen Fenster angezeigt haben wollen, sodass sie zoomen können, wählen sie unter \textit{Tools} $\rightarrow$ \textit{Preferences} $\rightarrow$ \textit{IPython console} $\rightarrow$ \textit{Graphics} $\rightarrow$ \textit{Backend} den Eintrag \textit{Automatic}. Anschließend müssen Sie evtl.\ Spyder schließen und erneut starten.
\vspace{-1ex}
......@@ -191,7 +191,7 @@ Spyder öffnet sich nun. Wenn Sie die Plots lieber in eigenständigen Fenster an
\includegraphics[width=\linewidth]{images/spyder-pref}
\vspace{-2em}
Laden Sie nun in Spyder das beigelegte Testprogramm \textattachfile{attachments/mnistKeras.py}{\texttt{mnistKeras.py}}.
Laden Sie nun in Spyder das Testprogramm \texttt{mnistKeras.py} (\textattachfile{attachments/mnistKeras.py}{Anhang}|\href{https://gitlab.cvh-server.de/ckaufmann/install-python-tensorflow-gym/-/raw/master/attachments/mnistKeras.py?inline=false}{Web}).
Starten Sie das Skript durch Drücken auf \keystroke{F5} bzw.\ den grünen Play-Button oben in Werkzeugleise bzw.\ über das Menü \textit{Run} $\rightarrow$ \textit{Run}.
\vspace{-1ex}
......@@ -209,7 +209,7 @@ Starten Sie VS Code z.\,B.\ über die Kommandozeile mit:
\begin{lstlisting}[gobble=2, basicstyle=\ttfamily\footnotesize]
code
\end{lstlisting}
Speichern Sie das beigelegte Testprogramm \textattachfile{attachments/mnistKeras.py}{\texttt{mnistKeras.py}} und klicken in VS Code auf Open Folder um das darüberliegende Verzeichnis zu öffnen. Öffnen Sie dann die Datei \textattachfile{attachments/mnistKeras.py}{\texttt{mnistKeras.py}}. Wie in der Abbildung dargestellt, installieren Sie die Python-Extension, wählen Sie den installierten Python-Interpreter (\lstinline|ml|) aus und klicken Sie anschließend mit der rechten Maustaste irgendwo in das Editor-Fenster:
Speichern Sie das Testprogramm \texttt{mnistKeras.py} (\textattachfile{attachments/mnistKeras.py}{Anhang}|\href{https://gitlab.cvh-server.de/ckaufmann/install-python-tensorflow-gym/-/raw/master/attachments/mnistKeras.py?inline=false}{Web}) und klicken in VS Code auf Open Folder um das darüberliegende Verzeichnis zu öffnen. Öffnen Sie dann die Datei \texttt{mnistKeras.py}. Wie in der Abbildung dargestellt, installieren Sie die Python-Extension, wählen Sie den installierten Python-Interpreter (\lstinline|ml|) aus und klicken Sie anschließend mit der rechten Maustaste irgendwo in das Editor-Fenster:
\vspace{-1em}
\noindent
......@@ -218,10 +218,10 @@ Speichern Sie das beigelegte Testprogramm \textattachfile{attachments/mnistKeras
\noindent
Falls Ihre Installation dort nicht auftaucht, wählen Sie bei \textit{Enter interpreter path...} den Installationspfad zur Binärdatei \lstinline|python| aus, also z.\,B.\ \texttt{/home/john/.local/opt/mambaforge/bin/python}. Spätestens dann nach Schritt 6 (Rechtsklick ins Editor-Fenster)
klicken Sie im Kontext-Menü auf \textit{Run Current File in Interactive Window}:
klicken Sie im Kontext-Menü auf \textit{Run in Interactive Window}\textit{Run Current File in Interactive Window}:
\vspace{-0.5em}
\begin{center}
\includegraphics[width=0.6\linewidth]{images/vscode-python-run-interactive}
\includegraphics[width=0.95\linewidth]{images/vscode-python-run-interactive}
\end{center}
\vspace{-0.5em}
Dadurch erhalten Sie rechts eine Konsole in dem eine interaktive Python-Session ausgeführt wird:
......
No preview for this file type
\RequirePackage{luatex85}
\documentclass[12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{verbatimbox}
\usepackage{graphicx}
......@@ -53,7 +52,7 @@
\title{Installationsanleitung für Python mit OpenAI Gym für Windows}
\date{April 2023}
\date{Mai 2023}
\author{Christof Kaufmann}
......@@ -178,7 +177,7 @@ Spyder öffnet sich nun. Wenn Sie die Plots lieber in eigenständigen Fenster an
\includegraphics[width=\linewidth]{images/spyder-pref}
\vspace{-2em}
Laden Sie nun in Spyder das beigelegte Testprogramm \textattachfile{attachments/mnistKeras.py}{\texttt{mnistKeras.py}}.
Laden Sie nun in Spyder das Testprogramm \texttt{mnistKeras.py} (\textattachfile{attachments/mnistKeras.py}{Anhang}|\href{https://gitlab.cvh-server.de/ckaufmann/install-python-tensorflow-gym/-/raw/master/attachments/mnistKeras.py?inline=false}{Web}).
Starten Sie das Skript durch Drücken auf \keystroke{F5} bzw.\ den grünen Play-Button oben in Werkzeugleise bzw.\ über das Menü \textit{Run} $\rightarrow$ \textit{Run}.
\vspace{-1ex}
......@@ -194,7 +193,7 @@ VS Code wird unabhängig von Mamba installiert und man wählt nachträglich die
Laden Sie es \href{https://code.visualstudio.com/docs/?dv=win64user}{hier} herunter und installieren es. Anschließend öffnen Sie VS Code. In VS Code drücken Sie \keystroke{Ctrl}+\keyshift+\keystroke P, suchen Sie die Einstellung \textit{Terminal: Select Default Profile} und wählen Sie \textit{Command Prompt}.
Speichern Sie das beigelegte Testprogramm \textattachfile{attachments/mnistKeras.py}{\texttt{mnistKeras.py}} und klicken in VS Code auf Open Folder um das darüberliegende Verzeichnis zu öffnen. Öffnen Sie dann die Datei \textattachfile{attachments/mnistKeras.py}{\texttt{mnistKeras.py}}. Installieren Sie die Python-Extension, wählen Sie den installierten Python-Interpreter (\lstinline|ml|) aus und klicken Sie anschließend mit der rechten Maustaste irgendwo in das Editor-Fenster:
Speichern Sie das Testprogramm \texttt{mnistKeras.py} (\textattachfile{attachments/mnistKeras.py}{Anhang}|\href{https://gitlab.cvh-server.de/ckaufmann/install-python-tensorflow-gym/-/raw/master/attachments/mnistKeras.py?inline=false}{Web}) und klicken in VS Code auf Open Folder um das darüberliegende Verzeichnis zu öffnen. Öffnen Sie dann die Datei \texttt{mnistKeras.py}. Installieren Sie die Python-Extension, wählen Sie den installierten Python-Interpreter (\lstinline|ml|) aus und klicken Sie anschließend mit der rechten Maustaste irgendwo in das Editor-Fenster:
\vspace{-1em}
\noindent
......@@ -202,10 +201,10 @@ Speichern Sie das beigelegte Testprogramm \textattachfile{attachments/mnistKeras
\vspace{-1.5em}
\noindent
Im Kontext-Menü klicken Sie auf \textit{Run Current File in Interactive Window}:
Im Kontext-Menü klicken Sie auf \textit{Run in Interactive Window}\textit{Run Current File in Interactive Window}:
\vspace{-0.5em}
\begin{center}
\includegraphics[width=0.6\linewidth]{images/vscode-python-run-interactive}
\includegraphics[width=0.95\linewidth]{images/vscode-python-run-interactive}
\end{center}
\vspace{-0.5em}
Dadurch erhalten Sie rechts eine Konsole in dem eine interaktive Python-Session ausgeführt wird:
......
[Desktop Entry]
Exec=bash -c "source ~/.local/opt/mambaforge/etc/profile.d/conda.sh && conda activate base && spyder"
GenericName=Python IDE
Icon=/home/john/.local/opt/mambaforge/lib/python3.10/site-packages/spyder/images/spyder.svg
MimeType=text/x-python;
Name=Spyder
Type=Application
[Desktop Entry]
Exec=bash -c "source ~/.local/opt/mambaforge/etc/profile.d/conda.sh && conda activate ml && spyder"
GenericName=Python IDE
Icon=/home/john/.local/opt/mambaforge/envs/ml/lib/python3.10/site-packages/spyder/images/spyder.svg
MimeType=text/x-python;
Name=Spyder
Type=Application
[Desktop Entry]
Exec=bash -c "source ~/.local/opt/mambaforge/etc/profile.d/conda.sh && conda activate weai && spyder"
GenericName=Python IDE
Icon=/home/john/.local/opt/mambaforge/envs/weai/lib/python3.10/site-packages/spyder/images/spyder.svg
MimeType=text/x-python;
Name=Spyder
Type=Application
images/vscode-python-run-interactive.png

11.2 KiB | W: 0px | H: 0px

images/vscode-python-run-interactive.png

23.8 KiB | W: 0px | H: 0px

images/vscode-python-run-interactive.png
images/vscode-python-run-interactive.png
images/vscode-python-run-interactive.png
images/vscode-python-run-interactive.png
  • 2-up
  • Swipe
  • Onion skin
No preview for this file type
\RequirePackage{luatex85}
\documentclass[12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[english]{babel}
\usepackage{amssymb}
\usepackage{xcolor}
......@@ -53,7 +52,7 @@
\usepackage[color=blue, author={Christof Kaufmann}]{attachfile2} % load after hyperref to avoid option clash from unicode=true
\title{Installation of Python via Mambaforge for Linux}
\date{December 2022}
\date{May 2023}
\author{Christof Kaufmann}
% one infinite page, https://tex.stackexchange.com/a/19241/115883
......@@ -136,6 +135,8 @@ When it's finished, let's start spyder
\begin{lstlisting}[gobble=2]
spyder &
\end{lstlisting}
Alternatively, you can use the desktop file (\textattachfile{attachments/Spyder-base.desktop}{attachment}|\href{https://gitlab.cvh-server.de/ckaufmann/install-python-tensorflow-gym/-/raw/master/attachments/Spyder-base.desktop?inline=false}{web}) to start it by double-clicking. Fix the path to the icon (example username is \texttt{john}) and make the file executable. Then copy it to your desktop folder (usually \lstinline|~/Desktop/|). If you want to see Spyder in the start menu in addition to the desktop, copy the file to \lstinline|~/.local/share/applications/|.
The Spyder window opens now. Set the graphics backend to \textit{Automatic} and click \textit{OK}, as shown here:
\vspace{-1ex}
......@@ -144,7 +145,7 @@ The Spyder window opens now. Set the graphics backend to \textit{Automatic} and
\vspace{-1.5em} % due to some transparent border in the image
\noindent
Open the attached test script \textattachfile{attachments/surfplot.py}{\texttt{surfplot.py}} and run it by pressing \keystroke{F5} or clicking on the green play button \textcolor{green!80!black}{$\blacktriangleright$} or by using the menu \textit{Run} $\rightarrow$ \textit{Run} and confirm. A new window opens with a surface plot like this:
Open the test script \texttt{surfplot.py} (\textattachfile{attachments/surfplot.py}{attachment}|\href{https://gitlab.cvh-server.de/ckaufmann/install-python-tensorflow-gym/-/raw/master/attachments/surfplot.py?inline=false}{web}) and run it by pressing \keystroke{F5} or clicking on the green play button \textcolor{green!80!black}{$\blacktriangleright$} or by using the menu \textit{Run} $\rightarrow$ \textit{Run} and confirm. A new window opens with a surface plot like this:
\vspace{-1ex}
\begin{center}
......
No preview for this file type
\RequirePackage{luatex85}
\documentclass[12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[english]{babel}
\usepackage{xcolor}
\usepackage{graphicx}
......@@ -52,7 +51,7 @@
\usepackage[color=blue, author={Christof Kaufmann}]{attachfile2} % load after hyperref to avoid option clash from unicode=true
\title{Installation of Python via Mambaforge for Linux}
\date{January 2023}
\date{May 2023}
\author{Christof Kaufmann}
% one infinite page, https://tex.stackexchange.com/a/19241/115883
......@@ -122,15 +121,18 @@ Now we are ready to install the packages we need.
Let's create a new environment called \textit{weai} and add the packages we need to it.
\textit{For GPU support replace \lstinline|tensorflow| by \lstinline|tensorflow-gpu=2.10| in the command below. This requires a recent propriatary NVIDIA driver installed via \lstinline|apt|, e.\,g.\ for Ubuntu \lstinline|nvidia-driver-510| or similar should be enough. For Debian \lstinline|nvidia-driver| might work (requires \lstinline|contrib| and \lstinline|non-free| in \lstinline|sources.list|).}
\begin{lstlisting}[gobble=2]
mamba create -n weai tensorflow spyder jupyter openpyxl tqdm mypy \
scikit-learn matplotlib seaborn ipympl odfpy
mamba create -n weai python=3.10 tensorflow spyder jupyter ipympl \
matplotlib seaborn tqdm mypy scikit-learn \
pandas openpyxl odfpy pyarrow notebook
\end{lstlisting}
You will get a list of packages and can confirm with \keyenter. Installation takes a while. Let's change into the \textit{weai} environment and start spyder
\begin{lstlisting}[gobble=2]
conda activate weai
spyder &
\end{lstlisting}
The Spyder window opens now. Open the attached test script \textattachfile{attachments/mnistKeras.py}{\texttt{mnistKeras.py}} and run it by pressing \keystroke{F5} or clicking on the green play button or by using the menu \textit{Run} $\rightarrow$ \textit{Run}.
Alternatively, you can use the desktop file (\textattachfile{attachments/Spyder-weai.desktop}{attachment}|\href{https://gitlab.cvh-server.de/ckaufmann/install-python-tensorflow-gym/-/raw/master/attachments/Spyder-weai.desktop?inline=false}{web}) to start it by double-clicking. Fix the path to the icon (example username is \texttt{john}) and make the file executable. Then copy it to your desktop folder (usually \lstinline|~/Desktop/|). If you want to see Spyder in the start menu in addition to the desktop, copy the file to \lstinline|~/.local/share/applications/|.
The Spyder window opens now. Open the test script \texttt{mnistKeras.py} (\textattachfile{attachments/mnistKeras.py}{attachment}|\href{https://gitlab.cvh-server.de/ckaufmann/install-python-tensorflow-gym/-/raw/master/attachments/mnistKeras.py?inline=false}{web}) and run it by pressing \keystroke{F5} or clicking on the green play button or by using the menu \textit{Run} $\rightarrow$ \textit{Run}.
\vspace{-1ex}
\noindent
......
No preview for this file type
\RequirePackage{luatex85}
\documentclass[12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[english]{babel}
\usepackage{amssymb}
\usepackage{xcolor}
......@@ -53,7 +52,7 @@
\usepackage[color=blue, author={Christof Kaufmann}]{attachfile2} % load after hyperref to avoid option clash from unicode=true
\title{Installation of Python via Mambaforge for Windows}
\date{December 2022}
\date{May 2023}
\author{Christof Kaufmann}
% one infinite page, https://tex.stackexchange.com/a/19241/115883
......@@ -132,7 +131,7 @@ The Spyder window opens now. Set the graphics backend to \textit{Automatic} and
\vspace{-1.5em} % due to some transparent border in the image
\noindent
Open the attached test script \textattachfile{attachments/surfplot.py}{\texttt{surfplot.py}} and run it by pressing \keystroke{F5} or clicking on the green play button \textcolor{green!80!black}{$\blacktriangleright$} or by using the menu \textit{Run} $\rightarrow$ \textit{Run} and confirm. A new window opens with a surface plot like this:
Open the test script \texttt{surfplot.py} (\textattachfile{attachments/surfplot.py}{attachment}|\href{https://gitlab.cvh-server.de/ckaufmann/install-python-tensorflow-gym/-/raw/master/attachments/surfplot.py?inline=false}{web}) and run it by pressing \keystroke{F5} or clicking on the green play button \textcolor{green!80!black}{$\blacktriangleright$} or by using the menu \textit{Run} $\rightarrow$ \textit{Run} and confirm. A new window opens with a surface plot like this:
\vspace{-1ex}
\begin{center}
......
No preview for this file type
\RequirePackage{luatex85}
\documentclass[12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[english]{babel}
\usepackage{xcolor}
\usepackage{graphicx}
......@@ -52,7 +51,7 @@
\usepackage[color=blue, author={Christof Kaufmann}]{attachfile2} % load after hyperref to avoid option clash from unicode=true
\title{Installation of Python via Mambaforge for Windows}
\date{April 2023}
\date{May 2023}
\author{Christof Kaufmann}
% one infinite page, https://tex.stackexchange.com/a/19241/115883
......@@ -137,7 +136,7 @@ and optionally (not required for Spyder) also add the path to the corresponding
\end{minipage}%
\noindent
The Spyder window opens now. Open the attached test script \textattachfile{attachments/mnistKeras.py}{\texttt{mnistKeras.py}} and run it by pressing \keystroke{F5} or clicking on the green play button or by using the menu \textit{Run} $\rightarrow$ \textit{Run} and confirm with \textit{Run}.
The Spyder window opens now. Open the test script \texttt{mnistKeras.py} (\textattachfile{attachments/mnistKeras.py}{attachment}|\href{https://gitlab.cvh-server.de/ckaufmann/install-python-tensorflow-gym/-/raw/master/attachments/mnistKeras.py?inline=false}{web}) and run it by pressing \keystroke{F5} or clicking on the green play button or by using the menu \textit{Run} $\rightarrow$ \textit{Run} and confirm with \textit{Run}.
\vspace{-1ex}
\noindent
......