How To Connect to a Running Virtual Environment

42 views
Skip to first unread message

erick....@smiledirectclub.com

unread,
Aug 25, 2016, 11:01:28 AM8/25/16
to virtualenvwrapper
New to Python and the virtual environment 

I have a number of virtual environments running or /venv/bin/python3.5 /venv/bin/gunicorn

Is there a way I connect to one of these environments? 

I found documentation showing how to create a new virtual environment and connect but not how to connect if it's after the fact. 

Jason Myers

unread,
Aug 25, 2016, 11:02:26 AM8/25/16
to virtuale...@googlegroups.com, erick....@smiledirectclub.com
Perhaps the workon command is what you are looking for?

Doug Hellmann

unread,
Aug 25, 2016, 12:31:58 PM8/25/16
to virtuale...@googlegroups.com
Are you asking how to make commands like “workon” use virtual environments that do not exist under your $WORKON_HOME directory?

Doug

erick....@smiledirectclub.com

unread,
Aug 25, 2016, 12:43:16 PM8/25/16
to virtualenvwrapper
Thank you for reaching out to me, yes. 

These are apps that have been running for some time and I want to access them. 

erick....@smiledirectclub.com

unread,
Aug 25, 2016, 1:26:11 PM8/25/16
to virtualenvwrapper
Got it, finally!

I went to the scrip that creates it or this line, virtualenv -p /usr/bin/python3.5 /venv

and did a source /ven/bin/activate

Looks to be working

So without looking at the script how would I know which virtual environments are available on a system? 

Doug Hellmann

unread,
Aug 26, 2016, 3:37:23 PM8/26/16
to virtuale...@googlegroups.com
On Aug 25, 2016, at 1:26 PM, erick....@smiledirectclub.com wrote:

Got it, finally!

I went to the scrip that creates it or this line, virtualenv -p /usr/bin/python3.5 /venv

and did a source /ven/bin/activate

Looks to be working

So without looking at the script how would I know which virtual environments are available on a system? 

virtualenvwrapper solves this by putting all of your virtualenvs in one directory, under $WORKON_HOME (the default is ~/.virtualenvs, but you can change it).

If you have them scattered around in other places, there’s not really any way for it to know where they are.

When I started using virtualenvwrapper, I recreated all of my existing virtualenvs in $WORKON_HOME.

Doug




On Thursday, August 25, 2016 at 11:43:16 AM UTC-5, erick....@smiledirectclub.com wrote:
Thank you for reaching out to me, yes. 

These are apps that have been running for some time and I want to access them. 

On Thursday, August 25, 2016 at 11:31:58 AM UTC-5, Doug Hellmann wrote:

> On Aug 25, 2016, at 11:01 AM, erick....@smiledirectclub.com wrote:
>
> New to Python and the virtual environment
>
> I have a number of virtual environments running or /venv/bin/python3.5 /venv/bin/gunicorn
>
> Is there a way I connect to one of these environments?
>
> I found documentation showing how to create a new virtual environment and connect but not how to connect if it's after the fact.

Are you asking how to make commands like “workon” use virtual environments that do not exist under your $WORKON_HOME directory?

Doug


--
You received this message because you are subscribed to the Google Groups "virtualenvwrapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to virtualenvwrap...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages