- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 django 和 mysql。
要使django与mysql通信,必须安装mysqlclient。
另外python版本是3.7.2
pipenv 安装 mysqlclient
它会抛出错误。
Installing mysqlclient...
✔ Installation Succeeded
Pipfile.lock (c98c3a) out of date, updating to (a65489)...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
✔ Success!
Updated Pipfile.lock (c98c3a)!
Installing dependencies from Pipfile.lock (c98c3a)...
An error occurred while installing mysqlclient==1.4.2.post1 --hash=sha256:425e733b05e359a714d6007c0fc44582be66b63e5a3df0a50949274ae16f4bc6 --hash=sha256:62e4770b6a797b9416bcf70488365b7d6b9c9066878108499c559293bb464380 --hash=sha256:f257d250f2675d0ef99bd318906f3cfc05cef4a2f385ea695ff32a3f04b9f9a7! Will try again.
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:02
Installing initially failed dependencies...
[pipenv.exceptions.InstallError]: File "/usr/local/lib/python2.7/site-packages/pipenv/core.py", line 1992, in do_install
[pipenv.exceptions.InstallError]: skip_lock=skip_lock,
[pipenv.exceptions.InstallError]: File "/usr/local/lib/python2.7/site-packages/pipenv/core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]: pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]: File "/usr/local/lib/python2.7/site-packages/pipenv/core.py", line 859, in do_install_dependencies
[pipenv.exceptions.InstallError]: retry_list, procs, failed_deps_queue, requirements_dir, **install_kwargs
[pipenv.exceptions.InstallError]: File "/usr/local/lib/python2.7/site-packages/pipenv/core.py", line 763, in batch_install
[pipenv.exceptions.InstallError]: _cleanup_procs(procs, not blocking, failed_deps_queue, retry=retry)
[pipenv.exceptions.InstallError]: File "/usr/local/lib/python2.7/site-packages/pipenv/core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]: raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: ['Collecting mysqlclient==1.4.2.post1 (from -r /var/folders/ll/4ql5wb555rqb9xcsdzr624b80000gn/T/pipenv-bV3RGM-requirements/pipenv-bOkuhH-requirement.txt (line 1))', ' 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): started', " Building wheel for mysqlclient (setup.py): finished with status 'error'", ' Running setup.py clean for mysqlclient', 'Failed to build mysqlclient', 'Installing collected packages: mysqlclient', ' Running setup.py install for mysqlclient: started', " Running setup.py install for mysqlclient: finished with status 'error'"]
[pipenv.exceptions.InstallError]: ['ERROR: Complete output from command /Users/hide/.local/share/virtualenvs/horang-mnXaGoVY/bin/python3.7 -u -c \'import setuptools, tokenize;__file__=\'"\'"\'/private/var/folders/ll/4ql5wb555rqb9xcsdzr624b80000gn/T/pip-install-83zphs9u/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/ll/4ql5wb555rqb9xcsdzr624b80000gn/T/pip-wheel-jhcy1h95 --python-tag cp37:', ' ERROR: running bdist_wheel', ' running build', ' running build_py', ' creating build', ' creating build/lib.macosx-10.14-x86_64-3.7', ' creating build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/_exceptions.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/compat.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/connections.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/converters.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/cursors.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/release.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/times.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' creating build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' copying MySQLdb/constants/CR.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' copying MySQLdb/constants/ER.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' warning: build_py: byte-compiling is disabled, skipping.', ' ', ' running build_ext', " building 'MySQLdb._mysql' extension", ' creating build/temp.macosx-10.14-x86_64-3.7', ' creating build/temp.macosx-10.14-x86_64-3.7/MySQLdb', " clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Dversion_info=(1,4,2,'post',1) -D__version__=1.4.2.post1 -I/usr/local/opt/mysql@5.7/include/mysql -I/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.o", ' clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk build/temp.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.o -L/usr/local/opt/mysql@5.7/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.cpython-37m-darwin.so', ' ld: library not found for -lssl', ' clang: error: linker command failed with exit code 1 (use -v to see invocation)', " error: command 'clang' failed with exit status 1", ' ----------------------------------------', ' ERROR: Failed building wheel for mysqlclient', ' ERROR: Complete output from command /Users/hide/.local/share/virtualenvs/horang-mnXaGoVY/bin/python3.7 -u -c \'import setuptools, tokenize;__file__=\'"\'"\'/private/var/folders/ll/4ql5wb555rqb9xcsdzr624b80000gn/T/pip-install-83zphs9u/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/ll/4ql5wb555rqb9xcsdzr624b80000gn/T/pip-record-t6u87iq3/install-record.txt --single-version-externally-managed --compile --install-headers /Users/hide/.local/share/virtualenvs/horang-mnXaGoVY/bin/../include/site/python3.7/mysqlclient:', ' ERROR: running install', ' running build', ' running build_py', ' creating build', ' creating build/lib.macosx-10.14-x86_64-3.7', ' creating build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/_exceptions.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/compat.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/connections.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/converters.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/cursors.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/release.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' copying MySQLdb/times.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb', ' creating build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' copying MySQLdb/constants/CR.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' copying MySQLdb/constants/ER.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants', ' warning: build_py: byte-compiling is disabled, skipping.', ' ', ' running build_ext', " building 'MySQLdb._mysql' extension", ' creating build/temp.macosx-10.14-x86_64-3.7', ' creating build/temp.macosx-10.14-x86_64-3.7/MySQLdb', " clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Dversion_info=(1,4,2,'post',1) -D__version__=1.4.2.post1 -I/usr/local/opt/mysql@5.7/include/mysql -I/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.o", ' clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk build/temp.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.o -L/usr/local/opt/mysql@5.7/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.cpython-37m-darwin.so', ' ld: library not found for -lssl', ' clang: error: linker command failed with exit code 1 (use -v to see invocation)', " error: command 'clang' failed with exit status 1", ' ----------------------------------------', 'ERROR: Command "/Users/hide/.local/share/virtualenvs/horang-mnXaGoVY/bin/python3.7 -u -c \'import setuptools, tokenize;__file__=\'"\'"\'/private/var/folders/ll/4ql5wb555rqb9xcsdzr624b80000gn/T/pip-install-83zphs9u/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/ll/4ql5wb555rqb9xcsdzr624b80000gn/T/pip-record-t6u87iq3/install-record.txt --single-version-externally-managed --compile --install-headers /Users/hide/.local/share/virtualenvs/horang-mnXaGoVY/bin/../include/site/python3.7/mysqlclient" failed with error code 1 in /private/var/folders/ll/4ql5wb555rqb9xcsdzr624b80000gn/T/pip-install-83zphs9u/mysqlclient/']
ERROR: ERROR: Package installation failed...
我试过pipenv install mysqlclient==1.13.13
,还是不行。
这里有解决办法吗?
谢谢。
最佳答案
我必须先安装这 3 个包才能让它为我工作:
如果您在云服务器上,他们会稍微精简操作系统,则尤其如此。这是复制粘贴命令:
sudo apt install -y python3-dev libmysqlclient-dev libssl-dev
几年后的更新:走上了pipenv
的道路,我不推荐它,我现在使用venv
关于python - 通过pipenv安装mysqlclient抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56133947/
这个问题是很多人都遇到过的,包括我自己。您不能直接使用命令 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
我是一名优秀的程序员,十分优秀!