[英]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.