Ask Your Question

How do I identify the executable for a virtual environment and use this in Wing?

asked 2017-03-03 12:16:00 -0600

Steven C. Howell's avatar

updated 2019-04-30 08:18:26 -0600

After creating and configuring a Python environment from the command line, e.g., using conda, how would I use this environment in Wing? 

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted

answered 2017-03-03 12:20:00 -0600

Steven C. Howell's avatar

updated 2020-01-22 20:00:32 -0600

As of Wing 7.2, you can set the Python Executable in Project Properties to "Activated Env" and enter the command that activates the environment.

In all versions of Wing you can instead set Python Executable to the virtualenv's Python, which you can find as follows:

  1. Run the interpreter for your virtual environment outside of Wing.

  2. From that interpreter, you can identify the executable for the environment by running the commands: 

    import sys print(sys.executable)

3. From Wing, open the Project Properties dialog.

  1. Set the Python Executable to be the output from the sys.executable command.
edit flag offensive delete link more


Note that in Wing 101 there are no Project Properties so this is set instead in the Configure Python dialog, from the Edit menu.

Wingware Support's avatar Wingware Support  ( 2017-03-03 12:52:00 -0600 )edit

answered 2019-04-09 10:48:52 -0600

chukwudi.nwachukwu's avatar

updated 2019-04-10 06:27:11 -0600

What about working with a remote host configuration, via SSH?

import sys; print(sys.executable)

gives me


But the Python shell that is connected by SSH gives me


I basically want to use the one that is from the virtualenv. How do I go about it? Please note that I tried setting it as instructed above but it did not work.

edit flag offensive delete link more


If you are using a remote host from within Wing, you'd enter /home/ichux/wingpro/venv-django2.2/bin/python for the Python Executable in the remote host configuration

Wingware Support's avatar Wingware Support  ( 2019-04-09 13:35:53 -0600 )edit

It worked! Thanks so much. I had initially tried it but it failed for reasons I can't explain.

chukwudi.nwachukwu's avatar chukwudi.nwachukwu  ( 2019-04-10 05:03:09 -0600 )edit

answered 2017-03-09 13:57:00 -0600

Jeffrey Vahue's avatar

One thing to note is if you switch active projects and switch from a 2.7 project to a 3.3 project the python shell does not automatically switch from 2.7 to 3.3, you have to manually ask it to restart the shell - so if you have not done that and you check the shell to see the Python version it might be wrong.

edit flag offensive delete link more


But also note that in Wing 7 it will now auto-restart the shell when you switch projects. This can be disabled from the Python Shell's Options menu.

Wingware Support's avatar Wingware Support  ( 2019-04-10 06:29:54 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-03-03 12:16:00 -0600

Seen: 7,648 times

Last updated: Jan 22 '20