DEV Community

Discussion on: Virtual Environments in Python

Collapse
 
k4ml profile image
Kamal Mustafa

You have to always manually activate / deactivate your virutalenv.

This I think one of the anti-pattern of virtualenv. In our team, we make it compulsory to use full path to the python instead of using activate. For example:-

/home/kamal/projects/juita/.env/bin/python manage.py runserver

This also make communication easier. There's no need for back and forth communication like "Are you sure you're using the correct python ? Have you run activate ?".

Collapse
 
rishibaldawa profile image
Rishi Baldawa

I just python for hobby projects so this hasn't happened to be as much but if there's a way to change the terminal prompt & reflect that you're in the wrong virualenv, the Q/As might drop drastically.

I definitely dig using the full path. I'll give that a shot next time I'm working on a project.