Configurazione dell'ambiente di sviluppo Python
Con il pacchetto di estensioni Qt for Python è possibile sviluppare Qt for Python applicazioni con VS Code e Python:
- Installare i pacchetti PySide6
- Creare applicazion Qt for Python i con interfacce utente basate su Qt Quick o Qt Widgets
- Compilare, eseguire e ripulire le applicazioni
- Eseguire il debug delle applicazioni con
debugpye il debugger QML - Leggere la documentazione di Qt for Python
Installare PySide6 per il progetto
Il modo consigliato per eseguire i progetti PySide6 da VS Code è installare PySide6 per ogni progetto. L'estensione Qt per VS Code richiede di farlo la prima volta che si apre un file .py per un progetto.
Per installare PySide6 per il progetto in un secondo momento:
- Vai su " Command Palette" e seleziona " Qt: Install PySide6".
- Selezionare " Create environment " per creare un nuovo ambiente virtuale per il progetto. Per utilizzare un ambiente esistente, selezionare " Select environment".
Creare un ambiente virtuale con uv
Se avete installato il gestore di pacchetti Python "uv" e lo avete aggiunto al PATH, potete utilizzarlo per creare l’ambiente virtuale:
- Vai su Command Palette e seleziona Qt: Create virtual environment with uv.
- Selezionare « Create environment » per creare un nuovo ambiente virtuale per il progetto. Per utilizzare un ambiente esistente, selezionare « Select environment ».
Vedi anche Installazione, Tutorial: Qt Quick e Qt for Python, Creazione di progetti Qt, Debug delle applicazioni Qt for Python e Lettura della documentazione Qt.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.