Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fbf9ab4

Browse files
committed
Portiere Schummelzettel in README.md
1 parent c7d465f commit fbf9ab4

1 file changed

Lines changed: 159 additions & 2 deletions

File tree

README.md

Lines changed: 159 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,159 @@
1-
# PythonSetup
2-
Mein Schummelzettel für Python 3.
1+
# Python 3 Schummelzettel
2+
3+
![Python](https://img.shields.io/badge/python-3-blue)
4+
![License](https://img.shields.io/badge/license-Apache%202.0-green)
5+
6+
7+
Dies ist mein persönlicher Schummelzettel für Python 3 unter Linux. Andere Plattformen wurden nicht getestet.
8+
9+
---
10+
11+
## Inhaltsverzeichnis
12+
13+
- [Python-Skript ausführen](#python-skript-ausführen)
14+
- [Paketverwaltung mit pip](#paketverwaltung-mit-pip)
15+
- [Virtuelle Umgebung](#virtuelle-umgebung)
16+
- [Jupyter](#jupyter)
17+
- [PyTorch](#pytorch)
18+
- [Lizenz](#lizenz)
19+
20+
---
21+
22+
## Python-Skript ausführen
23+
24+
```bash
25+
# Python-Skript ausführen
26+
python3 <PYTHON.PY-DATEI>
27+
28+
# Einzeiler ausführen, z. B. NumPy
29+
python3 -c "import numpy as np; print(np.__version__)"
30+
31+
# Modul-Aufruf (z. B. pip)
32+
python3 -m pip list
33+
```
34+
35+
---
36+
37+
## Paketverwaltung mit pip
38+
39+
```bash
40+
# pip installieren
41+
sudo apt install python3-pip
42+
43+
# pip selbst aktualisieren
44+
python3 -m pip install --upgrade pip
45+
# oder einfacher:
46+
pip install --upgrade pip
47+
48+
# Paket installieren
49+
pip install <PAKET>
50+
51+
# Alle Pakete aus requirements.txt installieren
52+
pip install -r requirements.txt
53+
54+
# Installierte Pakete anzeigen
55+
pip list
56+
57+
# Paket aktualisieren (zB NumPy)
58+
pip install --upgrade numpy
59+
60+
# Paket deinstallieren
61+
pip uninstall <PAKET>
62+
63+
# Unbenötigte Abhängigkeiten entfernen
64+
pip install pip-autoremove
65+
pip-autoremove <PAKET>
66+
67+
# pip Cache leeren
68+
pip cache purge
69+
70+
# Paket in Ordner installieren (unabhängig vom Standard-Python-Pfad)
71+
pip install -t <ORDNER> <PAKETE>
72+
73+
# Python-Projekt im Entwickler-Modus installieren
74+
# Voraussetzung: setup.py oder pyproject.toml
75+
pip install -e .
76+
77+
# PYTHONPATH setzen
78+
export PYTHONPATH="$HOME/meinOrdner:$PYTHONPATH"
79+
80+
# Sauberer mit Bash-Parameterexpansion
81+
export PYTHONPATH="$HOME/meinOrdner${PYTHONPATH:+:$PYTHONPATH}"
82+
```
83+
84+
---
85+
86+
## Virtuelle Umgebung
87+
88+
```bash
89+
# Virtuelle Umgebung erzeugen
90+
python3 -m venv /path/to/directory
91+
92+
# Aktivieren
93+
source /path/to/directory/bin/activate
94+
95+
# Pakete installieren
96+
pip install <PAKETE>
97+
98+
# Deaktivieren
99+
deactivate
100+
```
101+
102+
---
103+
104+
105+
## Jupyter
106+
107+
Website: https://jupyter.org/
108+
109+
```bash
110+
# Jupyter Notebook installieren/aktualisieren
111+
pip install --upgrade notebook
112+
113+
# Notebook starten
114+
jupyter notebook
115+
116+
# JupyterLab installieren/aktualisieren
117+
pip install --upgrade jupyterlab
118+
119+
# JupyterLab starten
120+
jupyter lab
121+
```
122+
123+
### Zugriff von Rechner A auf Rechner B über SSH
124+
125+
```bash
126+
# Auf Rechner B
127+
jupyter lab --no-browser --port=8888
128+
129+
# Auf Rechner A (SSH-Port-Forwarding)
130+
ssh -N -L 8888:localhost:8888 benutzername@IP_VON_RECHNER_B
131+
```
132+
133+
Auf Rechner A im Browser öffnen:
134+
http://localhost:8888
135+
136+
---
137+
138+
139+
## PyTorch
140+
141+
Website: https://pytorch.org/
142+
143+
```bash
144+
# Installation inklusive CUDA
145+
pip install torch torchvision torchaudio
146+
147+
# Installation der CPU-Version
148+
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
149+
```
150+
151+
---
152+
153+
## Lizenz
154+
155+
Dieses Projekt ist unter der Apache License 2.0 lizenziert. Siehe [LICENSE](LICENSE) für Details.
156+
157+
Weitere Informationen zur Lizenz finden Sie hier: https://www.apache.org/licenses/LICENSE-2.0
158+
159+
---

0 commit comments

Comments
 (0)