1

I need to use python black (the code formatter), but seeing this issue

  • for that I first moved to the git branch where I need to update environment with black package
  • then activate the environment with conda activate my_env
  • then I installed black using conda install -c conda-forge black
  • then I checked if black was installed using conda list -n my_env black (it was present in list)
  • then I used black to format a file with command black file_name.py

I am seeing this issue: https://www.screencast.com/t/8PzgwTMt

Unable to create process using <path>/python.exe <path>/black-script.py filename.py

Jean-Francois T.
  • 11,549
  • 7
  • 68
  • 107
  • 2
    Try `python -m black file_name.py`. Same/no/different error? – Tin Nguyen Mar 12 '20 at 09:13
  • ..../../python.exe No module name black error appears – Sidrah Madiha Siddiqui Mar 12 '20 at 09:16
  • This points towards `black` not being installed. I'm unfamiliar with condo and can't help you there. I usually use pip. – Tin Nguyen Mar 12 '20 at 09:18
  • SOLUTION: I had 2 similar environment variables C:\Users\Username\Anaconda3;C:\Users\Username\Anaconda3\Scripts; I uninstalled conda which removed these 2 variables, reinstalled with path addition selected (which mean only the latter path was added in environment variables itself) , then in the envrionment I installed Black using pip, works correctly now – Sidrah Madiha Siddiqui Mar 22 '20 at 23:04
  • Just had this same issue and @TinNguyen's comment solved it – a11 Dec 13 '22 at 22:03

0 Answers0