Yes indeed. I used to have Python 2.7 installed, and the system path pointed to its directories rather than to the Python 3 ones. I actually had to write a batch file to jam the 3.x directories first on the path when I ran Python 3.x. Even then I still used python3 -m pip to make sure I ran the right version.
Now it's a habit. On Thursday, September 23, 2021 at 1:45:45 PM UTC-4 jkn wrote: > I use 'python3 -m pylint...' rather that just 'pylint'. I was sure there > was a better way, but that dependes on getting pip/pip3 etc. sorted, and > life is too short... > > > On Wednesday, September 22, 2021 at 2:05:50 PM UTC+1 [email protected] > wrote: > >> I use -m all the time, including (mostly) running Leo. and running pip. >> Another advantage with pip is that you always get the right version of pip, >> which is really good when you have several versions of Python installed. >> >> On Wednesday, September 22, 2021 at 8:58:41 AM UTC-4 Edward K. Ream wrote: >> >>> A few days ago I had one of those "Why didn't I see this before?" >>> moments. >>> >>> Invoking a python package via `python -m package` is simpler and more >>> general. For example: >>> >>> python -m black -h >>> >>> There is no need to specify the path to black! >>> >>> We only need to ensure that `python` invokes python 3. We can do this >>> with an alias (linux) or .cmd file (windows). Here is my python.cmd file: >>> >>> "C:\Users\Edward Ream\Python\Python39\python.exe" %* >>> >>> Now (in devel) Leo's "blacken-files" command invokes black this way: >>> >>> g.execute_shell_commands( >>> f"&python -m black --skip-string-normalization {path}") >>> >>> Edward >>> >> -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/d4da9301-6569-4bef-ab60-06ebf855bb00n%40googlegroups.com.
