[PySide] Qt Creator and virtualenv

Cristián Maureira-Fredes Cristian.Maureira-Fredes at qt.io
Mon Feb 24 10:53:46 CET 2020


On 2/23/20 1:23 PM, info at mycontent.gr wrote:
> Dear all,
> 
> Is there a way to activate a Python virtual environment inside Qt 
> Creator, i.e. ensure that all the different commands that Qt Creator is 
> issuing to prepare/analyse/build the current project are run inside a 
> specific virtualenv?
> 
> I encounter this problem while trying to use Shiboken/PySide in order to 
> create a scriptable application. I can successfully compile and run the 
> "scriptableapplication" example from Pyside, across Windows, OSX and 
> Linux, using CMake. But when I try to use Qt Creator and qmake, and open 
> the scriptableapplication.pro project in Qt Creator, I get the following 
> message:
> 
>      Unable to locate shiboken2-generator. Did you forget to activate 
> your virtualenv?
> 
> which is indeed true, the virtualenv is not activated for the shell 
> commands that Qt Creator is issuing.
> 
> Thank you for your help.
> 
> Kind regards,
> 
> George Christodoulides

Hello George,

Since Qt Creator 4.11 (I believe...)
it's possible to select the Python interpreter you are using.

Additionally, QtCreator can detect if you have a virtual environment
inside your project too.

As a reference:

https://codereview.qt-project.org/c/qt-creator/qt-creator/+/279007
https://codereview.qt-project.org/c/qt-creator/qt-creator/+/275894

Cheers


-- 
Dr. Cristian Maureira-Fredes
R&D Manager

The Qt Company GmbH
Erich-Thilo-Str. 10
D-12489 Berlin

Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht
Charlottenburg, HRB 144331 B
--


More information about the PySide mailing list