Open Doekeb opened 3 years ago
I am experiencing the same issue and have followed the same troubleshooting steps described by Doekeb without success :/
possible insight that might help debugging:
mine was working fine then i did an pip3 install --upgrade black
New version (broken):
❯ black --version
black, 21.12b0 (compiled: no)
I cant remember what version I had before but I rolled back to pip3 install black==21.10b0
and its working again
Same. Only black==21.10b
worked
For anyone looking for a quick solution: pip install --upgrade black==21.10b0
Figured out the issue, version number is getting reported differently now.
regex is looking for black, version X.Y.Z
but version is now black, X.Y.Z
Cracked open packages/atom-beautify/src/beautifiers/black.coffee
and updated the catch:
try
text.match(/black, version (\d+\.\d+)/)[1] + "." + text.match(/b(\d+)$/)[1]
catch
try
text.match(/black, version (\d+\.\d+)/)[1] + ".0"
catch
text.match(/black, (\d+\.\d+\.\d+)/)[1]
Good enough for me, will look into contributing a proper PR for it when I have the bandwidth.
Description
Atom Beautify cannot find Black. Running Atom Beautify on even an empty Python file fails with the following message:
Steps to Reproduce
test.py
.Atom Beautify: Beautify Editor
Note: I have double-checked that black is installed (in my system python—not a virtual environment). Running
which black
returns the absolute path. I get the same results as above even if I set the absolute path of the executable in Atom Beautify settings. Additionally, I can successfully run black on a file manually from the command line.Debug
Here is a link to the
debug.md
Gist: https://gist.github.com/Doekeb/28a2722ef36c776a733b61d3e5d9f0baChecklist
I have:
Atom Beautify: Help Debug Editor
command in Atom and added link fordebug.md
Gist to this issue