Python的安装位置取决于你的操作系统和安装时的选择。以下是一些常见的安装路径:
Windows系统
默认情况下,Python安装在`C:\PythonXX`,其中`XX`是Python的版本号,例如`C:\Python39`。
如果你选择“Just for me”安装,Python可能会安装在`C:\Users\[用户名]\AppData\Local\Programs\Python\Python39-32`。
如果你选择“For all users”安装,Python可能会安装在`C:\Python39`。
Linux系统
Python通常安装在`/usr/bin/pythonX.X`或`/usr/local/bin/pythonX.X`,其中`X.X`是Python的版本号,例如`/usr/bin/python3.9`。
macOS系统
Python默认安装在`/Library/Frameworks/Python.framework/Versions/XX`,其中`XX`是Python的版本号,例如`/Library/Frameworks/Python.framework/Versions/3.8`。
查找Python安装路径的方法
在命令行中输入`where python`(Windows)或`which python`(Linux/macOS)可以显示Python的安装路径。
在Python解释器中输入`import sys; print(sys.executable)`也可以显示当前Python解释器的路径。
请根据你的操作系统和安装选项选择合适的安装位置。