我已经浏览了几十篇关于此问题的帖子,但似乎没有任何效果,所以我想我只是错过了一些东西,但我正在做一个关于使用 python 制作网站的初学者教程,所以我不完全确定我要做什么我做错了。我做到了
brew install mysql
在安装过程结束时我看到了这个:(我不知道此时是否出了问题)
/usr/bin/install_name_tool: object: /usr/local/Cellar/mysql/5.6.20_1/lib/libmysqlclient.18.dylib malformed object (unknown load command 9)
/usr/bin/install_name_tool: object: /usr/local/Cellar/mysql/5.6.20_1/lib/libmysqlclient.18.dylib malformed object (unknown load command 9)
==> /usr/local/Cellar/mysql/5.6.20_1/bin/mysql_install_db --verbose --user=giancosta --basedir=/usr/local/Cellar/mysql/5.6.20_1 --datadir=/usr/local/var/
/usr/local/Cellar/mysql/5.6.20_1/bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mysql`
==> Summary
🍺 /usr/local/Cellar/mysql/5.6.20_1: 9579 files, 342M
然后我就这么做了
sudo easy_install mysql-python
结尾为:(同样,我不知道此时是否出了问题)
20 warnings generated.
ld: warning: ignoring file /usr/local/Cellar/mysql/5.6.20_1/lib/libmysqlclient_r.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
zip_safe flag not set; analyzing archive contents...
Adding MySQL-python 1.2.5 to easy-install.pth file
Installed /Library/Python/2.7/site-packages/MySQL_python-1.2.5-py2.7-macosx-10.8-intel.egg
Processing dependencies for mysql-python
Finished processing dependencies for mysql-python
最后我跑了:
mysqld
但我得到:
dyld: Library not loaded: @@HOMEBREW_PREFIX@@/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/bin/mysqld
Reason: image not found
Trace/BPT trap: 5
因此,在查看其他帖子时,我尝试删除或卸载 openssl,然后重新安装它。但这是行不通的。我现在不知道该怎么办。我什至尝试卸载 mysql 以重新开始使用
sudo uninstall mysql
但这只是给了我:
Preparing Uninstall...
Uninstall Began...
Uninstall Failed...
Reason: ErrorMissingBundle
我是初学者,所以我现在真的不知道该怎么做/出了什么问题。我需要重新开始吗?如果是这样,怎么办?我读过一些关于链接和 OpenSSL 搞乱事情等的文章,但这对我来说还很陌生。任何帮助将不胜感激。
最佳答案
您应该尝试使用pip(一种用于安装和管理Python包的工具)来安装它。
pip install MySQL-python
关于python - 找不到 openssl 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25499991/