gpt4 book ai didi

python - 如何在 MySQL Workbench for Mac (Big Sur) 中添加系统路径路径

转载 作者:行者123 更新时间:2023-12-01 23:33:53 26 4
gpt4 key购买 nike

我在 Mac 上使用 Catalina OS 和 MySQL Workbench,它在我的旧 iMac 上运行良好。但是,当我最近购买了一台装有 Big Sur OS 的新 Mac 并安装了 MySQL Workbench 时,它给了我以下导入错误:

Fatal Python error: initfsencoding: unable to load the file system codec, sys.path = ['/Applications/MySQLWorkbench.app/Contents/Resources/libraries', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload']
ModuleNotFoundError: No module named 'encodings'

Current thread 0x000000011ac12e00 (most recent call first):

我知道这是由于系统路径配置不当造成的,因为我的python版本是3.8。所以我在bash_profile中添加了系统路径的路径。见下文:

export PYTHONPATH=~/Library/Python/3.8/lib/python/site-packages:$PYTHONPATH

export PATH=/usr/bin:$PATH

python shell 中生成的 sys.path 给了我这个:

Python 3.8.2 (default, Nov  4 2020, 21:23:28) 
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['', '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python38.zip', '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8', '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/lib-dynload', '/Users/phillipkim/Library/Python/3.8/lib/python/site-packages', '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages']

我获取了文件并重新启动了计算机。但是,当我尝试运行 MySQL Workbench 时收到相同的错误消息。我发现以下 website这解释了在哪里更新 MySQL Workbench 的系统环境,但它只显示了 Windows 和 Linux 操作系统的示例。如何将路径添加到 MySQL Workbench for Mac 的系统路径?非常感谢。

最佳答案

问题

enter image description here

Termination Reason: Namespace DYLD, 
Code 1 Library missing Library not loaded:
'/System/Library/Frameworks/Python.framework/Versions/2.7/Python'
Referenced from: '/Applications/MySQLWorkbench.app/Contents/MacOS/MySQLWorkbench'
Reason: tried: '/System/Library/Frameworks/Python.framework/Versions/2.7/Python'

解决方案

方法解释超过here对我来说效果很好。所以问题是 python 2.7 已从 Mac 12.3 中删除,这会影响 Workbench 等应用程序。

要使它们再次工作,您需要从官方下载中心下载 Python 2.7.x link .然后安装它,您的工具应该开始运行。

关于python - 如何在 MySQL Workbench for Mac (Big Sur) 中添加系统路径路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65907146/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com