Shell正在选择Python 2.7,但不是3.7(Shell is selecting Python 2.7, but not 3.7)

编程入门 行业动态 更新时间:2024-10-24 20:19:23
Shell正在选择Python 2.7,但不是3.7(Shell is selecting Python 2.7, but not 3.7)

我有Python 3.7 ,我有一个Python 2.7.

但是当我使用Python Launcher时,它使用2.7而不是3.7。

如何使用Python 3.7 ? 操作系统 - Mac OS。

I have Python 3.7 and I had a Python 2.7.

But when I am using Python Launcher it uses 2.7 not 3.7.

How to use Python 3.7? OS - Mac OS.

最满意答案

如果你想在终端中运行命令python时默认使用python 3.7,你可以在〜/ .bashrc中添加一个别名

alias python=python3.7

bashrc是一个shell脚本,bash在交互式启动时运行。 您可以在主目录中找到bashrc。

If you want python 3.7 as default when you run command python in terminal, you can add an alias in ~/.bashrc

alias python=python3.7

bashrc is a shell script that bash runs whenever it is started interactively. You can find bashrc in your home directory.

更多推荐

本文发布于:2023-08-07 00:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1457822.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Python   Shell   selecting

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!