Skip to content

Python3 - Pipenv für die virtuelle Entwicklungsumgebung

Python3
  • Python hat ein wirklich sehr groß entwickeltes Ökosystem, mit ganz vielen Tools, die man erst mal finden muss und dann im zweiten Step auch nutzen können muss.

    Hier geht es heute um pipenv

    01b9dc8f-34ae-4a32-b18a-5e06df39e960-grafik.png

    Installation

    sudo apt install pipenv
    

    Virtuelle Umgebung anlegen

    Wir wechseln ins Projektverzeichnis

    cd /home/$USER/projekt1
    

    Die Entwicklungsumgebung anlegen

    pipenv --python 3.8
    

    Die Entwicklungsumgebung starten

    frank@frank-MS-7C37:~/restic_ui$ pipenv shell
    Spawning environment shell (/bin/bash). Use 'exit' to leave.
    frank@frank-MS-7C37:~/restic_ui$ . /home/frank/.local/share/virtualenvs/restic_ui-RwXjz-0W/bin/activate
    (restic_ui-RwXjz-0W) frank@frank-MS-7C37:~/restic_ui$ pipenv
    Usage: pipenv [OPTIONS] COMMAND [ARGS]...
    
    Options:
      --where          Output project home information.
      --venv           Output virtualenv information.
      --py             Output Python interpreter information.
      --envs           Output Environment Variable options.
      --rm             Remove the virtualenv.
      --bare           Minimal output.
      --completion     Output completion (to be eval'd).
      --man            Display manpage.
      --three / --two  Use Python 3/2 when creating virtualenv.
      --python TEXT    Specify which version of Python virtualenv should use.
      --site-packages  Enable site-packages for the virtualenv.
      --version        Show the version and exit.
      -h, --help       Show this message and exit.
    
    
    Usage Examples:
       Create a new project using Python 3.6, specifically:
       $ pipenv --python 3.6
    
       Install all dependencies for a project (including dev):
       $ pipenv install --dev
    
       Create a lockfile containing pre-releases:
       $ pipenv lock --pre
    
       Show a graph of your installed dependencies:
       $ pipenv graph
    
       Check your installed dependencies for security vulnerabilities:
       $ pipenv check
    
       Install a local setup.py into your virtual environment/Pipfile:
       $ pipenv install -e .
    
       Use a lower-level pip command:
       $ pipenv run pip freeze
    
    Commands:
      check      Checks for security vulnerabilities and against PEP 508 markers
                 provided in Pipfile.
      clean      Uninstalls all packages not specified in Pipfile.lock.
      graph      Displays currently–installed dependency graph information.
      install    Installs provided packages and adds them to Pipfile, or (if none
                 is given), installs all packages.
      lock       Generates Pipfile.lock.
      open       View a given module in your editor.
      run        Spawns a command installed into the virtualenv.
      shell      Spawns a shell within the virtualenv.
      sync       Installs all packages specified in Pipfile.lock.
      uninstall  Un-installs a provided package and removes it from Pipfile.
      update     Runs lock, then sync.
    
  • Ich ko... immer, wenn ich mein VSCodium neu installieren muss. Das größte Problem dabei ist immer, das ich fast immer vergesse den Python Interpreter zu setzen.

    "CTRL+SHIFT+P" and choose the correct python interpreter.

    46f85075-4dbc-414c-94c2-abc5bb6009b6-grafik.png

    Danach startet das Python Programm auch wieder aus der richtigen Entwicklungsumgebung 🙂

  • Python - Frameworks

    Python3
    2
    0 Stimmen
    2 Beiträge
    76 Aufrufe
    FrankMF

    Und mal hier parken

  • Python - Match-Case Statement

    Python3
    1
    0 Stimmen
    1 Beiträge
    84 Aufrufe
    Niemand hat geantwortet
  • Python - mehrsprachiges GUI

    Python3
    1
    0 Stimmen
    1 Beiträge
    119 Aufrufe
    Niemand hat geantwortet
  • 0 Stimmen
    2 Beiträge
    215 Aufrufe
    FrankMF

    Der Autor hat meine Anpassungen um ein paar Änderungen erweitert und in sein Repo eingepflegt. Der QtWaitingSpinenr ist jetzt auch 3.10 kompatibel 🤓

    1b268980-92ca-42a4-89a0-a6e4b7ab9378-grafik.png

  • Restic UI - Changelog

    Angeheftet Restic UI
    3
    0 Stimmen
    3 Beiträge
    264 Aufrufe
    FrankMF

    v1.5.0 - Release for restic v0.14.0 with compression and migration tool

  • Python3 - QInputDialog

    Python3
    1
    0 Stimmen
    1 Beiträge
    135 Aufrufe
    Niemand hat geantwortet
  • Python3 - Eingabeformular

    Python3
    3
    0 Stimmen
    3 Beiträge
    191 Aufrufe
    FrankMF

    Meine endgültige Lösung, zu mindestens im Moment 😉 , ist ein zweites Window. Das gefällt mir am Besten, komme ich zu mindestens im Moment einfach besser mit klar. Aber, eines der größten Probleme war für mich, wie aktualisiere ich die Liste im Hauptfenster!? Da habe ich doch etliche Stunden dran rum gefummelt....

    Hier nur mal das Layout

    ##################### # Layout ##################### self.formGroupBox = QGroupBox("Form layout") layout = QFormLayout() layout.addRow(self.label_1) layout.addRow(QLabel("Backup Name:"), self.input1) layout.addRow(QLabel("Repository:"), self.button3) layout.addRow(QLabel("Source:"), self.button4) layout.addRow(QLabel("Password:"), self.input4) layout.addRow(self.label_6) layout.addRow(self.button2) self.formGroupBox.setLayout(layout) self.setLayout(layout)

    Das mit dem SecondWindow ist aber was aufwändiger. Da mach ich dann mal einen eigenen Beitrag zu. Aktuell sieht das so aus.

    6c68c956-9127-438f-bc54-4dcef8e18f00-image.png

  • Python3 - Globale Variablen

    Python3
    1
    0 Stimmen
    1 Beiträge
    128 Aufrufe
    Niemand hat geantwortet