I try to open a new terminal window in XFCE and activate python3 virtualenv in there 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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.