mac 安装python、pip、weditor

问题现象:执行 python3 -m weditor 报错

➜  ~ python3 -m weditor
dyld[42143]: dyld cache '(null)' not loaded: syscall to map cache into shared region failed
dyld[42143]: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  Referenced from: <DB2A01C0-6DBB-DB93-EC82-117C736AC754> /Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python
  Reason: tried: '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file), '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file, no dyld cache), '/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file)
[1]    42143 abort      python3 -m weditor

报错信息

问题原因:多版本问题导致

解决方案:重新安装python、pip、weditor

1、安装brew

安装bew 或者自行搜搜 /bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"
brew -v 入如果提示 gitxxx ,把提示的命名直接执行即可
eg:git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
eg:git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask

2、brew 安装python3

brew install python3

安装过程中如果提示 brew link xxx warning,按照提示执行(版本冲突要覆盖)
eg:brew link --overwrite python@3.11
安装成功检查直接输入 python3,会显示版本好就好

3、安装pip

下载 curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
安装 python3 get-pip.py
检查是否安装成功 pip -V

4、安装weditor

安装 python3 -m pip install weditor

5、运行weditor

python3 -m weditor

此时浏览器会打开http://localhost:17310/

参考文档
1、https://stackoverflow.com/questions/63089237/usr-local-bin-pip-bad-interpreter-usr-local-opt-python-bin-python3-7
2、http://events.jianshu.io/p/2e9e156bf897

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值