pythondetective
pythondetective

Reputation: 336

virtualenv does not get activated in new bash shell

I activate python virtualenv in one bash and tries to use in another bash shell. virtualenv simply does not work.

I opened a terminal, activate the virtualenv through sourcing activate file. It got activated in my terminal it shows () in front of terminal address.

I opened a new terminal. The effect is not visible in the newly opened terminal.

Anyone here help me please?

Upvotes: 1

Views: 1177

Answers (1)

Jérémy
Jérémy

Reputation: 108

You have to activate the virtualenv in every shell, or, as 0range suggested, activate it in your .bashrc or any script running before your shell displays the prompt.

To add it to your .bashrc :

  • Edit /home/youruser/.bashrc and add the line : source /path/to/bin/activate
  • Open a new shell or source ~/.bashrc

Everything should be alright.

Upvotes: 2

Related Questions