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


264
views
1
6 months ago by

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

modified 6 months ago by Jeffrey Vahue   • written 6 months ago by Steven C. Howell  

2 Answers


1
6 months ago by

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.

4. Set the Python Executable to be the output from the

sys.executable

command.

modified 6 months ago by Steven C. Howell   • written 6 months ago by Steven C. Howell  
1

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

written 6 months ago by Wingware Support  
1
6 months ago by

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.

modified 6 months ago by Jeffrey Vahue   • written 6 months ago by Jeffrey Vahue  
Please log in to add an answer/comment or follow this question.

Similar posts:
Search »