Issue
I have several virtual environment in my computer and sometimes I am in doubt about which python virtual environment I am using. Is there an easy way to find out which virtual environment I am connected to?
Solution
You can use sys.prefix
to determine which virtualenv you're in.
import sys
print(sys.prefix)
from the sys
docs
A string giving the site-specific directory prefix where the platform independent Python files are installed
Answered By - wpercy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.