Provision for user to troubleshoot `Command not found.` error
See original GitHub issueCurrently, if nbqa and the QA tool to run are installed in different python environments, we would get ValueError: Command black not found. Please make sure you have it installed before running nbqa on it.
This feature adds a provision in nbqa to dump the path of the tool that will be run by nbqa using a command which
or a flag --which
. This can be print user friendly message if the tool cannot be found by nbqa.
It could be something like
nbqa which black
- This will introduce a new command.
This would make the user to better troubleshoot this issue and we can document how to handle this scenario in nbqa’s documentation, thus making the user solve such issues on their own.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
How to fix a "Command not found" error in Linux - Red Hat
5 ways to fix "Command not found" errors · 1. Include the path · 2. Add a new path · 3. Copy a...
Read more >Troubleshoot installation issues for Microsoft Defender for ...
Command -line tool "mdatp" isn't working. If running the command-line tool mdatp gives an error command not found , run the following command:....
Read more >11 Ways to Fix "The System Cannot Find The Path Specified ...
1. Run Command Prompt as an Administrator ... Windows utilities cannot access all files and folders available on your device. Administrative ...
Read more >How to fix bash:command not found error in Linux/Unix
To fix this issue permanently so that this issue does not comes up again. You can add the default location of all the...
Read more >'\r': command not found - .bashrc / .bash_profile - Stack Overflow
Try running the dos2unix command on the file in question. It might help when you see error messages like this: -bash: '\r': command...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is the approach I am thinking of
nbqa black --find
to display black location, version etc as found by nbqa. I can useimportutil
,imp
,pkg_resources
modules. This is the success scenario where nbqa is able to find the tool.pip(from same location as sys.executable) install black
or point to setting up python virtual environment. If case where user can’t resolve this issue, then we can display a message to file bug/issue at nbqa github repo. We can also show a URL to nbqa read the docs in the same message for the user to look at the list of officially tested/supported tools, this way we can keep the nbqa code from displaying officially supported tools.nbqa black abc.ipynb --nbqa-mutate
, if the nbqa raisesValueError("Command not found")
in that exception message in addition to what we display today, we will also ask the user to runnbqa black --find
to troubleshoot this issue.This one can be done with minimal changes and it will serve the purpose I think. Please reply if you have any queries.
Thanks both for reviewing. I will start the implementation.