Ask Your Question

Using wing pro with pyscaffold

asked 2020-01-28 14:43:00 -0500

andykmiles gravatar image

updated 2020-02-12 09:04:16 -0500

I use pyscaffold to create all my projects and conda to manage the virtual environments. Everything just works in all IDEs (or it has to date). In Wing 7.2 the package imports all show errors, and pytest will not run (it fails with cannot read any output from test runner). The correct environment is active and package modules all run, although the editor shows imports as invalid (even though everything works). Tried under linux and windows. Any ideas?

edit retag flag offensive close merge delete


Is Wing using the right Python or venv? What is the Python Executable in Project Properties set to? Also, you can see the effective Python Path, which would affect whether Wing finds modules in imports, in the Source > Show Python Environment dialog.

Wingware Support gravatar imageWingware Support ( 2020-01-28 20:44:32 -0500 )edit

Yes I'm using the correct venv, and I have project properties set to activate it with the correct command. The environment is definitely active and all modules are found, but pytest just does not complete successfully. I have tried this on windows and linux. It is easy to reproduce. Just try running pytest

andykmiles gravatar imageandykmiles ( 2020-02-02 13:04:51 -0500 )edit

What version of pytest is it? Also is it failing in the Testing tool or in the debugger with code started outside of that tool?

Wingware Support gravatar imageWingware Support ( 2020-02-03 08:08:47 -0500 )edit

I've not been able to reproduce this yet, so having some more info and/or a test case would be useful. What _might_ be relevant is that Wing 7.2 detects when Python is Anaconda and calls 'conda activate base' to avoid environment bugs seen before we did this. This works around Anaconda's assumption that you're using conda envs (with 'conda activate'). When that isn't used, Anaconda does not set up PATH right so loading some DLLs fails. Activating base does work using virtualenv instead (as opposed to conda envs), but perhaps there's an issue with this. One idea is to try both setting Python Executable to Command Line and entering the virtualenv's Python, and also setting it to Activated Env and entering the activate command instead, in case one or the other of those is not subject to any problem that may exist ...(more)

Wingware Support gravatar imageWingware Support ( 2020-02-04 08:53:35 -0500 )edit

This is probably due to a bug in Wing <=, when Python Executable is set to Activated Env. Finding the value of sys.executable and using that with the Command Line option for Python Executable instead is a work-around. We're working on a fix.

Wingware Support gravatar imageWingware Support ( 2020-02-06 15:45:49 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-02-12 09:04:04 -0500

If it was the issue with using Activated Env for Python Executable, then this should be fixed in update, which you can get with Check for Updates in the Help menu. Please let us know if that does not solve it.

edit flag offensive delete link more


It is fixed! I am massively impressed at your follow up and fixing this. I love Wing Pro, and I teach about 60 students a year, and I always recommend it. Great support - thank you

andykmiles gravatar imageandykmiles ( 2020-02-17 13:23:15 -0500 )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: 2020-01-28 14:43:00 -0500

Seen: 277 times

Last updated: Feb 17