- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 Mac OSX 上安装 mysqlclient,因为 Django 需要使用 MySql 而不是 sqlite DB。
我最初尝试过 pip3 install mysqlclient
但我遇到了这样的错误:
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3f/1z_bg4h52lz8n0_gc1mp7gwh0000gn/T/pip-install-em4vq6dr/mysqlclient/
我已经进行了大量的谷歌搜索并尝试了很多建议(这似乎是一个常见问题),现在我得到了更多的错误消息:
Collecting mysqlclient==1.3.1
Downloading https://files.pythonhosted.org/packages/6b/ba/4729d99e85a0a35bb46d55500570de05b4af10431cef174b6da9f58a0e50/mysqlclient-1.3.1.tar.gz (76kB)
100% |████████████████████████████████| 81kB 2.0MB/s
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-install-4nhdinpy/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-wheel-41536ku7 --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
copying _mysql_exceptions.py -> build/lib.macosx-10.9-x86_64-3.6
creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.9-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Dversion_info=(1,3,1,'final',1) -D__version__=1.3.1 -I/usr/local/Cellar/mysql/8.0.15/include/mysql -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _mysql.c -o build/temp.macosx-10.9-x86_64-3.6/_mysql.o
_mysql.c:40:10: fatal error: 'my_config.h' file not found
#include "my_config.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-install-4nhdinpy/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-record-o9decnbp/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
copying _mysql_exceptions.py -> build/lib.macosx-10.9-x86_64-3.6
creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb
creating build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-x86_64-3.6/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.9-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Dversion_info=(1,3,1,'final',1) -D__version__=1.3.1 -I/usr/local/Cellar/mysql/8.0.15/include/mysql -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _mysql.c -o build/temp.macosx-10.9-x86_64-3.6/_mysql.o
_mysql.c:40:10: fatal error: 'my_config.h' file not found
#include "my_config.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-install-4nhdinpy/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-record-o9decnbp/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/z_/k_j3hrx10gn5w244fpvzw01r0000gn/T/pip-install-4nhdinpy/mysqlclient/
有人对我哪里出错有任何建议吗?
使用 Python 3.6
谢谢
克里斯
最佳答案
已根据这篇文章修复它 - https://github.com/PyMySQL/mysqlclient-python/issues/169#issuecomment-306821834 - 但我只做了这一点:
运行 brew info openssl
将以下内容作为两个单独的命令输入
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
然后:
pip3 install mysqlclient
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... done
Stored in directory: /Users/chris/Library/Caches/pip/wheels/30/91/e0/2ee952bce05b1247807405c6710c6130e49468a5240ae27134
Successfully built mysqlclient
Installing collected packages: mysqlclient
Successfully installed mysqlclient-1.4.2.post1
关于mysql - 在 Mac OS 上安装 mysqlclient 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55108530/
这个问题是很多人都遇到过的,包括我自己。您不能直接使用命令 pip install mysqlclient 来获取 python 3.7.4 或任何 3.7.X 的最新版本。PyPI 网站上提到新版本
当我将我的应用程序上传到服务器进行测试时,我遇到了这个奇怪的莫名其妙的错误。我查了一下,好像是MySql.Data冲突导致的,我上传的副本是:6.3.7.0。 我该如何解决这个问题?我以为只要将它放入
我正在尝试在我新格式化的 Mac OS High Sierra 10.13.4 上运行我的 Python 3 项目,首先运行 pipenv install 以获取依赖项,但失败了。 具体来说,安装依赖
我正在 Mac 上使用 MySQL 8.0 设置一个新的 Django 2.2 项目。我已经安装了 mysqlclient 和 mysql-connector-python。当我点击 python m
我搜索了论坛,但找不到答案,甚至找不到任何相关文档。尝试重新创建一个像 www.testandtrack.io 这样的网站 关于运行命令: python manage.py inspectdb 我收到
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
pip install mysqlclient Collecting mysqlclient Using cached mysqlclient-2.0.3.tar.gz (88 kB) Using
我下载了wheel到最新版本 但我不完全确定如何理解这个半神秘的错误消息 Failed building wheel for mysql-python Command "/Users/user
尝试从 pipenv 安装: pipenv install mysqlclient 将导致: Installing mysqlclient… Collecting mysqlclient Using
所以我下载了 Python 32 位 1,然后我做了python -m pip install mysqlclient . 我需要 Visual C++ 2015,但我有它们,因为我的文本编辑器是 V
我不知道如果我从这里下载mysqlclient-python,我是否会承担任何恶意软件和安全方面的风险https://pypi.python.org/pypi/mysqlclient ?您认为 PyP
我尝试使用 gcc 在新机器(CentOS 7)上编译旧项目。最后缺少的链接器是 libmysqlclient。 但我在我的 CentOS Repos(基础、更新、附加)中找不到它。 有人知道它在哪个
我使用的是 python 2.7.15 版本,我还做了 pip2.7 install --upgrade mysqlclient 但是,我要连接到所有 5.6 或 5.7 版本的远程数据库,但无法连接
尝试从 pipenv 安装: pipenv install mysqlclient 将导致: Installing mysqlclient… Collecting mysqlclient Using
我是 Python 和 Flask 的新手,在研究这些示例时,我忍不住注意到游标。在此之前,我用 PHP 编程,从不需要游标。所以我想知道:什么是游标,为什么在这些代码示例中如此频繁地使用游标? 但无
我有一个连接到 MySQL 服务器的 C++ 应用程序。 一切正常。 目前使用libmysql.dll。 在构建时,我链接到 libmysql.lib。 据我所知,我可以改为链接到 mysqlclie
我目前正在使用 C# 使用 ODBC 连接到我的 MySQL 数据库。有人告诉我,使用 MySql 连接器会更好、更快,并且不依赖于 Windows。有人可以对此有所了解吗?到目前为止,我一直无法在网
我正在使用 windows10 64 位、python 3.8.2 并且无法通过 pip3 安装 mysqlclient/mysql,它要求我下载 Microsoft Visual C++ 14.00
在尝试安装 mysqlclient 作为在 AWS EC2 实例上启动和运行 Django 项目的一部分时,我遇到了以下问题。 在 python 3.8.5 虚拟环境中: (venv3)$ which
我尝试在 mac 上的虚拟环境中安装 mysqlclient ,使用以下命令: pip3 install mysqlclient 我收到以下错误: Collecting mysqlclient U
我是一名优秀的程序员,十分优秀!