In the terminal, it works to do
python -c "import sys; print(sys.version)"
but doing
:python -c "import sys; print(sys.version)"
in vim throws a SyntaxError.
Press CMD + Space to open Spotlight. Type “ terminal ” and press enter. Execute command : type python ‐‐version or python -V and press Enter . The Python version appears in the next line below your command.
You can also just open a blank VIM document by typing vi or vim in your terminal. The welcome screen will state your version as well as other information.
The Pip, Pipenv, Anaconda Navigator, and Conda Package Managers can all be used to list installed Python packages. You can also use the ActiveState Platform's command line interface (CLI), the State Tool to list all installed packages using a simple “state packages” command.
Even back in 12.04, the vim package depended on Python (2.7 at the time). This supports Python scripting inside Vim. which shows no python3 requirement.
I just discovered here that you can also do it with
:python import sys; print(sys.version)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With