简体   繁体   English

如何找到安装python3的路径?

[英]How do I find the path where python3 is installed?

I current trying to use TwilioQuest to learn Python.我目前正在尝试使用 TwilioQuest 来学习 Python。 I have installed Python 3.7 and have followed their instructions but keep getting error messages when I run their code.我已经安装了 Python 3.7 并按照他们的说明进行操作,但在运行他们的代码时不断收到错误消息。 I am required to find out where Python is installed on my machine but cannot get this information following their recommended steps.我需要找出 Python 安装在我的机器上的位置,但无法按照他们推荐的步骤获取此信息。

I'd be very grateful if anyone could help me figure this out.如果有人能帮我解决这个问题,我将不胜感激。

Thanks in advance for any help.提前感谢您的帮助。

Using the built-in sys module, you can return a string representing the absolute path to the interpreter that is running the current script or terminal session with sys.executable使用内置的sys模块,您可以返回一个字符串,该字符串表示运行当前脚本的解释器的绝对路径或带有sys.executable

Example例子

import sys

print(sys.executable)

Run the following code:运行以下代码:

find /usr/ -iname python*

It will output all the python installations on your pc.它将 output 在您的 PC 上安装所有 python。 If you are looking for a specific version you can replace * with version number.如果您正在寻找特定版本,您可以将 * 替换为版本号。

Try navigate to the directory C:\Users\user_name\AppData\Local\Programs\Python.尝试导航到目录 C:\Users\user_name\AppData\Local\Programs\Python。

I found it in this installation guide ( https://www.ics.uci.edu/~pattis/common/handouts/pythoneclipsejava/python.html#:~:text=Navigate%20to%20the%20directory%20C,icon%2Ffile%20python.exe. )我在这个安装指南( https://www.ics.uci.edu/~pattis/common/handouts/pythoneclipsejava/python.html#:~:text=Navigate%20to%20the%20directory%20C,icon% 2Ffile%20python.exe。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在vscode中选择python解释器时,如何找到通过wsl2安装的virtualenv路径? - How do I find the virtualenv path installed via wsl2 when choosing python interpreter in vscode? macos中python3安装在哪里? - Where is python3 installed in macos? 在哪里可以找到带有 Python3 的 WidgetRedirector? - Where can I find WidgetRedirector in with Python3? 我在Mac上安装了python 2.7和3.6。 如何找到与Python3相关的pip版本? - I have python 2.7 and 3.6 installed on my mac. How to find the version of pip associated with Python3? cygwin上安装了Python3和Python2-如何运行pip / w Python 3 - Python3 and Python2 installed on cygwin - how do I run pip /w Python 3 尽管我用 pip 安装了我的 python3,但我如何在我的 mac 中找到 IDLE? - how can i find IDLE in my mac though i installed my python3 with pip? 如何找到 Python 在 Windows 上的安装位置? - How can I find where Python is installed on Windows? 如何让命令行中的 python3 指向我用 homebrew 安装的版本? - How do I get python3 in the command line to point to the version I installed with homebrew? Synology的Python,如何安装Python3模块以及安装Python2.7的位置? - Python at Synology, how to get Python3 modules installed and where is Python2.7 installed? 已安装Django,但python3找不到它 - Django is installed but python3 does not find it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM