我已经浏览了几十篇关于此的帖子,似乎没什么用,所以我觉得我只是缺少一些东西,但我正在做一个使用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搞砸事情等的帖子,但这对我来说非常陌生。任何帮助将不胜感激。
答案 0 :(得分:0)
您应该尝试使用pip(用于安装和管理Python包的工具)来安装它。
pip install MySQL-python