У меня есть три версии Python
Я установил все версии. Теперь, когда я пытаюсь проверить все версии Python, которые я установил, с помощью команд
py -0 #Doesn't Working
python3.9.11 -m venv app1 #its also not working
python --list #its also not working
python -h #shows this
C:\Users\91783>python -h
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options (and corresponding environment variables):
-b : issue warnings about str(bytes_instance), str(bytearray_instance)
and comparing bytes/bytearray with str. (-bb: issue errors)
-B : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x
-c cmd : program passed in as string (terminates option list)
-d : turn on parser debugging output (for experts only, only works on
debug builds); also PYTHONDEBUG=x
-E : ignore PYTHON* environment variables (such as PYTHONPATH)
-h : print this help message and exit (also -? or --help)
-i : inspect interactively after running script; forces a prompt even
if stdin does not appear to be a terminal; also PYTHONINSPECT=x
-I : isolate Python from the user's environment (implies -E and -s)
-m mod : run library module as a script (terminates option list)
-O : remove assert and __debug__-dependent statements; add .opt-1 before
.pyc extension; also PYTHONOPTIMIZE=x
-OO : do -O changes and also discard docstrings; add .opt-2 before
.pyc extension
-P : don't prepend a potentially unsafe path to sys.path; also PYTHONSAFEPATH
-q : don't print version and copyright messages on interactive startup
-s : don't add user site directory to sys.path; also PYTHONNOUSERSITE
-S : don't imply 'import site' on initialization
-u : force the stdout and stderr streams to be unbuffered;
this option has no effect on stdin; also PYTHONUNBUFFERED=x
-v : verbose (trace import statements); also PYTHONVERBOSE=x
can be supplied multiple times to increase verbosity
-V : print the Python version number and exit (also --version)
when given twice, print more information about the build
-W arg : warning control; arg is action:message:category:module:lineno
also PYTHONWARNINGS=arg
-x : skip first line of source, allowing use of non-Unix forms of #!cmd
-X opt : set implementation-specific option
--check-hash-based-pycs always|default|never:
control how Python invalidates hash-based .pyc files
--help-env : print help about Python environment variables and exit
--help-xoptions : print help about implementation-specific -X options and exit
--help-all : print complete help information and exit
Arguments:
file : program read from script file
- : program read from stdin (default; interactive mode if a tty)
arg ...: arguments passed to program in sys.argv[1:]
нет команды для проверки установленной версии и переключения между этими версиями. Каким будет его решение? Даже я удалил и переустановил все, но не помогло.






Пробовали ли вы проверить конкретную версию Python, на которой работает ваше устройство?
python -version
Также рекомендуется проверить, какая версия Python хранится в переменной среды (при условии, что вы используете ОС Windows). И измените его (если необходимо), чтобы он отражал именно ту версию Python, которую вы хотите :).
Попробуйте провести дальнейшее исследование использования команды python -E, поскольку она игнорирует путь Python в переменных среды. Посмотрите, поможет ли это решить вашу проблему.
Я переустановил несколько версий Python и включил команду «-py» для каждой версии. Кроме того, в переменных среды я установил путь к файлу (версия Python), гарантируя, что путь к любой версии, расположенной вверху, будет считаться используемой версией Python.
Да, я проверил! Python -V показывает 3.9.11 и в переменной env, когда я помещаю путь 3.11.8 к этой версии сверху или к другой версии, тогда он меняет несколько версий, и это нормально. Но имеет ли смысл переходить к переменным env и сдвигать путь вверх и вниз? Поэтому мы используем команду «py -0», которая у меня не работает, или команду «python --list», чтобы просмотреть мои версии, которая также не работает.