Einführung
In diesem Lab lernen Sie, wie Sie überprüfen können, ob ein Python-Modul installiert ist. Das Lab beginnt mit der Erklärung der Modulinstallation mithilfe von pip
, dem Paketinstaller für Python, und zeigt, wie Sie die requests
-Bibliothek installieren. Sie verwenden Befehle wie pip install requests
(und Alternativen mit --user
oder sudo
, falls erforderlich), um das Modul zu installieren.
Anschließend führt das Lab Sie durch die Überprüfung der Installation, indem Sie versuchen, das Modul in einem Python-Skript zu importieren. Sie erstellen eine Datei namens check_requests.py
und fügen Code hinzu, um das requests
-Modul zu importieren, damit Sie die erfolgreiche Installation bestätigen können.
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
python(("Python")) -.-> python/ModulesandPackagesGroup(["Modules and Packages"])
python(("Python")) -.-> python/ErrorandExceptionHandlingGroup(["Error and Exception Handling"])
python(("Python")) -.-> python/NetworkingGroup(["Networking"])
python/ModulesandPackagesGroup -.-> python/importing_modules("Importing Modules")
python/ErrorandExceptionHandlingGroup -.-> python/catching_exceptions("Catching Exceptions")
python/ErrorandExceptionHandlingGroup -.-> python/raising_exceptions("Raising Exceptions")
python/NetworkingGroup -.-> python/http_requests("HTTP Requests")
subgraph Lab Skills
python/importing_modules -.-> lab-559544{{"Wie man prüft, ob ein Python-Modul installiert ist"}}
python/catching_exceptions -.-> lab-559544{{"Wie man prüft, ob ein Python-Modul installiert ist"}}
python/raising_exceptions -.-> lab-559544{{"Wie man prüft, ob ein Python-Modul installiert ist"}}
python/http_requests -.-> lab-559544{{"Wie man prüft, ob ein Python-Modul installiert ist"}}
end