First time here? Check out the FAQ!
1

Using Black with an Activated Env

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

RunDeep's avatar
68
RunDeep
asked 2020-02-04 16:30:07 -0600
Wingware Support's avatar
4.2k
Wingware Support
updated 2020-02-12 09:05:02 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

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.

Wingware Support's avatar
4.2k
Wingware Support
answered 2020-02-12 09:04:52 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

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!

Wingware Support's avatar
4.2k
Wingware Support
answered 2020-02-04 21:45:32 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer