[Python] Open terminal in XFCE from script and activate python virtualenv

Discussão em 'Python' iniciado por Stack, Setembro 13, 2025.

  1. Stack

    Stack Membro Participativo

    I try to open terminal in XFCE and activate python3 virtualenv using the following line in a bash script:

    xfce4-terminal --working-directory=$HOME/path/to/project --maximize \
    -e 'bash -c "source $HOME/path/to/project/venv/bin/activate; bash"'


    The strange thing is that the virtualenv gets kind of activated since:

    which python


    shows the correct path to the virtualenv directory and the project seems to be working fine.

    However I don't see the (venv) to the left from the shell prompt. Moreover, when I enter deactivate it complains that no such command can be found.

    Is there a proper way to solve this problem?

    Continue reading...

Compartilhe esta Página