未找到openssl库

0 投票
1 回答
1057 浏览
提问于 2025-04-18 18:32

我看了很多关于这个问题的帖子,但似乎都没什么用,所以我觉得我可能漏掉了什么。我正在做一个关于用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搞砸了等等,但对我来说这些都很陌生。任何帮助都会非常感激。

1 个回答

0

你可以试试用 pip 这个工具来安装它。pip 是一个用来安装和管理 Python 包的工具。

pip install MySQL-python

撰写回答