mac os 如何更改默认python (python2.7=>python)

本文介绍如何在终端中将Python3设置为默认的Python版本。通过编辑.zprofile文件并添加alias指令,可以轻松实现这一目标。只需打开终端,编辑.zprofile,添加alias python='python3',保存并重启终端即可。此后,在终端中输入python将直接启动Python3。

打开终端
1.nano .zprofile
在这里插入图片描述
2.alias python=‘python3’
(确保你有python3)
在这里插入图片描述
3.保存退出 重启终端
输入python
在这里插入图片描述

venv) mac@macdeMacBook-Pro project % python -c "import paddle; print(paddle.__version__)" /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages/paddle/utils/cpp_extension/extension_utils.py:718: UserWarning: No ccache found. Please be aware that recompiling all source files may be required. You can download and install ccache from: https://github.com/ccache/ccache/blob/master/doc/INSTALL.md warnings.warn(warning_message) 3.2.2 (venv) mac@macdeMacBook-Pro project % pip uninstall paddleocr -y WARNING: Skipping paddleocr as it is not installed. (venv) mac@macdeMacBook-Pro project % pip install "paddleocr>=2.7.0.3" --no-cache-dir Collecting paddleocr>=2.7.0.3 Downloading paddleocr-3.3.2-py3-none-any.whl.metadata (55 kB) Requirement already satisfied: paddlex<3.4.0,>=3.3.0 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (3.3.12) Requirement already satisfied: PyYAML>=6 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddleocr>=2.7.0.3) (6.0.2) Requirement already satisfied: requests in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddleocr>=2.7.0.3) (2.32.5) Requirement already satisfied: typing-extensions>=4.12 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddleocr>=2.7.0.3) (4.15.0) Requirement already satisfied: aistudio-sdk>=0.3.5 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (0.3.8) Requirement already satisfied: chardet in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (5.2.0) Requirement already satisfied: colorlog in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (6.10.1) Requirement already satisfied: filelock in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (3.20.1) Requirement already satisfied: huggingface-hub in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (1.2.3) Requirement already satisfied: modelscope>=1.28.0 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (1.33.0) Requirement already satisfied: numpy>=1.24 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (2.2.6) Requirement already satisfied: packaging in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (25.0) Requirement already satisfied: pandas>=1.3 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (2.3.3) Requirement already satisfied: pillow in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (12.0.0) Requirement already satisfied: prettytable in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (3.17.0) Requirement already satisfied: py-cpuinfo in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (9.0.0) Requirement already satisfied: pydantic>=2 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (2.12.5) Requirement already satisfied: ruamel.yaml in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (0.18.17) Requirement already satisfied: ujson in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (5.11.0) Requirement already satisfied: imagesize in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (1.4.1) Requirement already satisfied: opencv-contrib-python==4.10.0.84 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (4.10.0.84) Requirement already satisfied: pyclipper in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (1.4.0) Requirement already satisfied: pypdfium2>=4 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (5.2.0) Requirement already satisfied: python-bidi in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (0.6.7) Requirement already satisfied: shapely in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (2.1.2) Requirement already satisfied: psutil in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from aistudio-sdk>=0.3.5->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (7.2.0) Requirement already satisfied: tqdm in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from aistudio-sdk>=0.3.5->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (4.67.1) Requirement already satisfied: bce-python-sdk in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from aistudio-sdk>=0.3.5->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (0.9.56) Requirement already satisfied: click in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from aistudio-sdk>=0.3.5->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (8.3.1) Requirement already satisfied: setuptools in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from modelscope>=1.28.0->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (80.9.0) Requirement already satisfied: urllib3>=1.26 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from modelscope>=1.28.0->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (2.6.2) Requirement already satisfied: python-dateutil>=2.8.2 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from pandas>=1.3->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (2.9.0.post0) Requirement already satisfied: pytz>=2020.1 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from pandas>=1.3->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (2025.2) Requirement already satisfied: tzdata>=2022.7 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from pandas>=1.3->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (2025.3) Requirement already satisfied: annotated-types>=0.6.0 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from pydantic>=2->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (0.7.0) Requirement already satisfied: pydantic-core==2.41.5 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from pydantic>=2->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (2.41.5) Requirement already satisfied: typing-inspection>=0.4.2 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from pydantic>=2->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (0.4.2) Requirement already satisfied: six>=1.5 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas>=1.3->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (1.17.0) Requirement already satisfied: charset_normalizer<4,>=2 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from requests->paddleocr>=2.7.0.3) (3.4.4) Requirement already satisfied: idna<4,>=2.5 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from requests->paddleocr>=2.7.0.3) (3.11) Requirement already satisfied: certifi>=2017.4.17 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from requests->paddleocr>=2.7.0.3) (2025.11.12) Requirement already satisfied: pycryptodome>=3.8.0 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from bce-python-sdk->aistudio-sdk>=0.3.5->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (3.23.0) Requirement already satisfied: future>=0.6.0 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from bce-python-sdk->aistudio-sdk>=0.3.5->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (1.0.0) Requirement already satisfied: fsspec>=2023.5.0 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from huggingface-hub->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (2025.12.0) Requirement already satisfied: hf-xet<2.0.0,>=1.2.0 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from huggingface-hub->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (1.2.0) Requirement already satisfied: httpx<1,>=0.23.0 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from huggingface-hub->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (0.28.1) Requirement already satisfied: shellingham in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from huggingface-hub->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (1.5.4) Requirement already satisfied: typer-slim in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from huggingface-hub->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (0.21.0) Requirement already satisfied: anyio in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from httpx<1,>=0.23.0->huggingface-hub->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (4.12.0) Requirement already satisfied: httpcore==1.* in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from httpx<1,>=0.23.0->huggingface-hub->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (1.0.9) Requirement already satisfied: h11>=0.16 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from httpcore==1.*->httpx<1,>=0.23.0->huggingface-hub->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (0.16.0) Requirement already satisfied: exceptiongroup>=1.0.2 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from anyio->httpx<1,>=0.23.0->huggingface-hub->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (1.3.1) Requirement already satisfied: wcwidth in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from prettytable->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (0.2.14) Requirement already satisfied: ruamel.yaml.clib>=0.2.15 in /Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages (from ruamel.yaml->paddlex<3.4.0,>=3.3.0->paddlex[ocr-core]<3.4.0,>=3.3.0->paddleocr>=2.7.0.3) (0.2.15) Downloading paddleocr-3.3.2-py3-none-any.whl (86 kB) Installing collected packages: paddleocr Successfully installed paddleocr-3.3.2 (venv) mac@macdeMacBook-Pro project % python -c "import paddleocr; print(paddleocr.__version__)" Checking connectivity to the model hosters, this may take a while. To bypass this check, set `DISABLE_MODEL_SOURCE_CHECK` to `True`. 3.3.2 (venv) mac@macdeMacBook-Pro project % python ocr_test.py Checking connectivity to the model hosters, this may take a while. To bypass this check, set `DISABLE_MODEL_SOURCE_CHECK` to `True`. Traceback (most recent call last): File "/Users/mac/Projects/GaPinyc/PaddleOCR/Test/project/ocr_test.py", line 12, in <module> ocr = PaddleOCR( File "/Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages/paddleocr/_pipelines/ocr.py", line 163, in __init__ super().__init__(**base_params) File "/Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages/paddleocr/_pipelines/base.py", line 63, in __init__ self._common_args = parse_common_args( File "/Users/mac/Projects/GaPinyc/PaddleOCR/Test/venv/lib/python3.10/site-packages/paddleocr/_common_args.py", line 45, in parse_common_args raise ValueError(f"Unknown argument: {name}") ValueError: Unknown argument: layout_analysis (venv) mac@macdeMacBook-Pro project %
最新发布
12-28
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值