sublack icon indicating copy to clipboard operation
sublack copied to clipboard

No such file or directory: 'black'

Open Gabriel-p opened this issue 3 years ago • 1 comments

I've install black within my conda environment called py3. My project is set to use this interpreter:

	"settings":
	{
		"python_interpreter": "/home/gabriel/miniconda3/envs/py3/bin/python",
	},

but when I try to apply black I get the error:

DeepinScreenshot_sublime_text_20210730113530

Gabriel-p avatar Jul 30 '21 14:07 Gabriel-p

Ok. I figured it out. Go to Preferences -> Package settings -> sublack -> Settings In the new sublack.sublime-settings file, paste the following: { "black_command": "C:/Users/analk/AppData/Local/Packages/PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0/LocalCache/local-packages/Python310/Scripts/black.exe", }

To find the particular path for, in your python interpretor,

import black print(black.path)

The output will be a folder's path. There will be a folder named 'Scripts' on the same level as 'site-packages' folder. The black.exe file will be inside the Scripts folder. You'll have to provide that path in the above "black_command" line.

analkumar2 avatar Feb 18 '22 09:02 analkumar2