Ask Your Question
1

Using Black with an Activated Env

asked 2020-02-04 16:30:07 -0500

RunDeep gravatar image

updated 2020-02-12 09:05:02 -0500

I've used Anaconda with Wing projects for quite a while by pointing to the env python.exe and adding to the path in the project settings. Then using OS Commands I could run Black:

${WING:PYTHON} -m black --target-version py36 ${WING:FILENAME}

I've switched over to the setup described here: https://wingware.com/doc/howtos/anaconda and I can debug my scripts in Wing but when I try to run Black I get:

Process failed to start: Could not create process (last error=2): activate C:\SVNRepo\projects-sw\Agile_new\trunk\env -m black --target-version py36 C:\SVNRepo\projects-sw\agile_db_py3\trunk\env\projects\reference_check.py

I've tried several variations with no luck... How do I set this up?

In the project settings I have Python Executable set to Activated Env; activate C:\SVNRepo\projects-sw\Agile_new\trunk\env

Python Path is Use default

7.2.0.1 (rev 2e712fd65dd4) Win 7 64, 32 bit Python

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

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

This should be fixed in update 7.2.1.1, which you can get with Check for Updates from the Help menu. Please let us know if that doesn't solve it.

edit flag offensive delete link more
0

answered 2020-02-04 21:45:32 -0500

Looks like there is a bug with Black and YAPF reformatting support when the Python Executable is set to Activated Env.

A work-around would be to get the value of sys.executable from the activated env (e.g. from Wing's Python Shell) and use that value for Command Line instead for the Python Executable in Project Properties. Then it should correctly start Black.

We'll try to fix this soon. Thanks for reporting this problem!

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

3 followers

Stats

Asked: 2020-02-04 16:30:07 -0500

Seen: 113 times

Last updated: Feb 12