Python: Anaconda

Aus Flinkwiki
Wechseln zu: Navigation, Suche
Seitenübersicht
Zur Seite "Python"
Zur Seite "Python: Klassen"
Zur Seite "Python: Module"
Zur Seite "Python: Turtle"
Zur Seite "Python: Tkinter"
Zur Seite "Python: Pygame"
Zur Seite "Python: PyQT"


Allgemeines

Anaconda ist eine Open-Source-Distribution für die Programmiersprachen Python und R, die unter anderem die Entwicklungsumgebung Spyder, den Kommandozeileninterpreter IPython, und ein webbasiertes Frontend für Jupyter enthält. Der Fokus liegt vor allem auf der Verarbeitung von großen Datenmengen, Vorhersageanalyse und wissenschaftlichem Rechnen. Das Ziel der Distribution ist die Vereinfachung von Paketmanagement und Softwareverteilung. Paketversionen werden von der Paketverwaltung conda verwaltet.[1]


Installation

Download von der Seite

Installation in Ubuntu: Die Installation benötigt keine root-Rechte und das Programm installiert sich im Verzeichnis des Benutzers.

bash Anaconda3-2020.11-Linux-x86_64.sh (Eventuell den Dateinamen und den Namen der heruntergeladenen Datei ersetzen.)

[2]


Navigator

Der Anaconda-Navigator wird im bin-Verzeichnis der Installation gestartet:

anaconda3/bin/anaconda-navigator

Jupyter Notebook

Jupyter Notebook starten

  1. Locate and open your Anaconda Navigator.
  2. Search for Jupyter Notebook in Anaconda Navigator and click it.
  3. A new window should open in the web browser of your choice.

Beim Start von Jupyter Notebook öffnet sich die Verzeichnisansicht http://localhost:8888/tree

... copy everything that follows >>> in a cell in your Jupyter Notebook; that is, you exclude >>>. To run code, make sure the cell is highlighted, then press Shift + Enter. You may also press the Run button at the top of the Notebook, but this takes more time. Start thinking like a developer and use keystrokes instead.


Jupyter Notebook in Python-Skript umwandeln

jupyter nbconvert --to script [YOUR_NOTEBOOK].ipynb

Im Notebook:

!jupyter nbconvert --to script [YOUR_NOTEBOOK].ipynb

Arbeit mit Visual Studio Code

Creating a new notebook Open the command palette with the shortcut: Ctrl/Command + Shift + P

Search for the command Create New Blank Jupyter Notebook

How to get back to the start page Open the command palette with the shortcut: Ctrl/Command + Shift + P

Search for the command Python: Open Start Page


Getting started You are currently viewing what we call our Notebook Editor. It is an interactive document based on Jupyter Notebooks that supports the intermixing of code, outputs and markdown documentation.

This cell is a markdown cell. To edit the text in this cell, simply double click on the cell to change it into edit mode.

The next cell below is a code cell. You can switch a cell between code and markdown by clicking on the code /markdown icons or using the keyboard shortcut M and Y respectively.


print('hello world') To execute the code in the cell above, click on the cell to select it and then either press the play button in the cell toolbar, or use the keyboard shortcut Ctrl/Command + Enter

To edit the code, just click in cell and start editing. To add a new cell below, click the Add Cell icon at the bottom left of the cell or enter command mode with the ESC Key and then use the keyboard shortcut B to create the new cell below.



Troubleshooting


JupyterLab

JupyterLab is the next-generation web-based user interface for Project Jupyter.[3]

JupyterLab kann aus dem Anaconda-Browser heraus gestartet werden

oder über das Terminal

jupyter lab

Spyder

IDE mit IPython-Terminal, Teil des Anaconda-Pakets. Kite kann als Plugin hinzuinstalliert werden.


| |