简体   繁体   English

在 Mac M1 中损坏的 Python

[英]Broken Python in Mac M1

I've messed up some python installations in MacBook Air M1我搞砸了 MacBook Air M1 中的一些 python 安装

On my command在我的命令下

python

This is the message I get这是我收到的信息

zsh: no such file or directory: /usr/local/bin/python3.9.2

But when I use但是当我使用

python3

It works!有用!

How do I make it work with python directly如何使其直接与 python 一起使用

You need to configure your aliases您需要配置别名

Type:类型:

alias python=python3

Or或者

alias python='/usr/local/bin/python3'

Run these first:首先运行这些:

alias python=/usr/local/bin/python3
alias pip=/usr/local/bin/pip3

It is annoying though, because macs come with a watered down version of python.不过这很烦人,因为 Mac 带有 python 的淡化版本。 I had it all set up before with a package manager and everything, but then the latest mac update wiped out my whole setup, and I even had to reinstall real python.我之前用 package 管理器和所有东西都设置好了,但后来最新的 mac 更新清除了我的整个设置,我什至不得不重新安装真正的 python。 now I jus type python3.现在我只需输入 python3。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM