【发布时间】:2023-12-28 10:10:01
【问题描述】:
* 中有类似的问题,但在 2020 年 2 月的 Mac OS Catalina 中,没有一个问题完全适合我。我什至没有尝试那些涉及大量更改权限、链接或低级解决方法的问题将来可能会付款。
【问题讨论】:
* 中有类似的问题,但在 2020 年 2 月的 Mac OS Catalina 中,没有一个问题完全适合我。我什至没有尝试那些涉及大量更改权限、链接或低级解决方法的问题将来可能会付款。
【问题讨论】:
我终于找到了一个类似但更安全的解决方案:
brew uninstall openssl
Homebrew 可能会警告您依赖它的其他软件包,特别是mysql,可能还有python@3.8 或其他。 不要强求,全部卸载即可:
brew uninstall mysql
brew uninstall python@3.8
brew uninstall ... # everything you have as dependencies
brew uninstall openssl
现在只需重新安装mysql 和openssl 也会自动重新安装,这次没有错误:
brew install mysql
现在一切都会恢复正常:
python
import MySQLdb
编辑
如果仍然失败,请查看是否是pip的缓存保留了问题:
brew info openssl # to copy your LDFLAGS path of the lib
pip uninstall mysqlclient
LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" pip install --no-cache-dir mysqlclient
python
import MySQLdb
【讨论】: