美文网首页
在Windos上速查Python执行路径

在Windos上速查Python执行路径

作者: SeanCheney | 来源:发表于2023-12-12 20:14 被阅读0次

在Linux和Mac上,使用which python,即可查看Python的执行路径。

但在Windows上,因为不支持which命令,需要使用其他方法。

使用以下的单行命令,即可快速查看Windows系统上的Python执行路径:

python -c "import os, sys; print(os.path.dirname(sys.executable))"

今天发现,在Windows上安装Miniconda后,使用其自带的Anaconda Powershell Prompt命令行工具更便捷,没有必要再下载Git Bash了。

相关文章

网友评论

      本文标题:在Windos上速查Python执行路径

      本文链接:https://www.haomeiwen.com/subject/mfavgdtx.html