「どのバージョンのPythonをインストールしたかを確認する方法」を尋ねていないことに注意してください。
WindowsコンピューターにいくつかのバージョンのPythonをインストールしました。たとえば、Python 2.7-64、Python 2.7-32、Python3.7-32などです。
Python 3には「py」と「pyw」が含まれており、さまざまなPythonを簡単に起動できます。次に例を示します。
私が疑問に思っているのは、Windows PCにインストールしたPythonの異なるバージョンの数と、それらのバージョンを確認する方法です。
PyCharmはそれを見つけることができますが、それが完全なリストであるかどうかはわかりません。また、Pythonが提供するツールやオペレーティングシステムでそれを実行できるツールがあるかどうかもわかりません。
私はちょうど答えを得ました。「py-h」または「py--help」と入力すると、ヘルプメッセージが表示されます。
C:\Users\admin>py -h
Python Launcher for Windows Version 3.7.1150.1013
usage:
py [launcher-args] [python-args] script [script-args]
Launcher arguments:
-2 : Launch the latest Python 2.x version
-3 : Launch the latest Python 3.x version
-X.Y : Launch the specified Python version
The above all default to 64 bit if a matching 64 bit python is present.
-X.Y-32: Launch the specified 32bit Python version
-X-32 : Launch the latest 32bit Python X version
-X.Y-64: Launch the specified 64bit Python version
-X-64 : Launch the latest 64bit Python X version
-0 --list : List the available pythons
-0p --list-paths : List with paths
これは、「-0」(文字「O」ではなくゼロ)が使用可能なpythonをリストしていることを示しています。
C:\Users\admin>py -0
Installed Pythons found by py Launcher for Windows
-3.7-64 *
-3.7-32
-2.7-64
-2.7-32
「-0p」はバージョンだけでなくパスもリストしますが、
C:\Users\admin>py -0p
Installed Pythons found by py Launcher for Windows
-3.7-64 C:\Users\admin\AppData\Local\Programs\Python\Python37\python.exe *
-3.7-32 C:\Users\admin\AppData\Local\Programs\Python\Python37-32\python.exe
-2.7-64 C:\Python27_64\python.exe
-2.7-32 C:\Python27_32\python.exe
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加